mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-27 14:32:08 +00:00
- Cleared developer warnings with modern (3.0+) versions of CMake.
This commit is contained in:
parent
44f9f2bbd6
commit
b958e930cf
5 changed files with 23 additions and 27 deletions
|
@ -1,6 +1,11 @@
|
|||
cmake_minimum_required( VERSION 2.4 )
|
||||
project(ZDoom)
|
||||
|
||||
if( COMMAND cmake_policy )
|
||||
cmake_policy( SET CMP0011 NEW )
|
||||
cmake_policy( SET CMP0054 NEW )
|
||||
endif( COMMAND cmake_policy )
|
||||
|
||||
list( APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR} )
|
||||
include( CreateLaunchers )
|
||||
include( FindPackageHandleStandardArgs )
|
||||
|
@ -26,8 +31,6 @@ endif(CMAKE_CROSSCOMPILING)
|
|||
|
||||
# Simplify pk3 building, add_pk3(filename srcdirectory)
|
||||
function( add_pk3 PK3_NAME PK3_DIR )
|
||||
get_target_property(ZIPDIR_EXE zipdir LOCATION)
|
||||
|
||||
# Generate target name. Just use "pk3" for main pk3 target.
|
||||
string( REPLACE "." "_" PK3_TARGET ${PK3_NAME} )
|
||||
if( ${PK3_TARGET} STREQUAL "zdoom_pk3" )
|
||||
|
@ -36,20 +39,22 @@ function( add_pk3 PK3_NAME PK3_DIR )
|
|||
|
||||
if( NOT NO_GENERATOR_EXPRESSIONS AND NOT ZDOOM_OUTPUT_OLDSTYLE )
|
||||
add_custom_command( OUTPUT ${ZDOOM_OUTPUT_DIR}/${PK3_NAME}
|
||||
COMMAND ${ZIPDIR_EXE} -udf ${ZDOOM_OUTPUT_DIR}/${PK3_NAME} ${PK3_DIR}
|
||||
COMMAND zipdir -udf ${ZDOOM_OUTPUT_DIR}/${PK3_NAME} ${PK3_DIR}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ZDOOM_OUTPUT_DIR}/${PK3_NAME} $<TARGET_FILE_DIR:zdoom>/${PK3_NAME}
|
||||
DEPENDS zipdir )
|
||||
else( NOT NO_GENERATOR_EXPRESSIONS AND NOT ZDOOM_OUTPUT_OLDSTYLE )
|
||||
add_custom_command( OUTPUT ${ZDOOM_OUTPUT_DIR}/${PK3_NAME}
|
||||
COMMAND ${ZIPDIR_EXE} -udf ${ZDOOM_OUTPUT_DIR}/${PK3_NAME} ${PK3_DIR}
|
||||
COMMAND zipdir -udf ${ZDOOM_OUTPUT_DIR}/${PK3_NAME} ${PK3_DIR}
|
||||
DEPENDS zipdir )
|
||||
endif( NOT NO_GENERATOR_EXPRESSIONS AND NOT ZDOOM_OUTPUT_OLDSTYLE )
|
||||
|
||||
# Touch the zipdir executable here so that the pk3s are forced to rebuild
|
||||
# each time since their dependecy has "changed."
|
||||
add_custom_target( ${PK3_TARGET} ALL
|
||||
COMMAND ${CMAKE_COMMAND} -E touch ${ZIPDIR_EXE}
|
||||
DEPENDS ${ZDOOM_OUTPUT_DIR}/${PK3_NAME} )
|
||||
if( NOT NO_GENERATOR_EXPRESSIONS )
|
||||
# Touch the zipdir executable here so that the pk3s are forced to
|
||||
# rebuild each time since their dependecy has "changed."
|
||||
add_custom_target( ${PK3_TARGET} ALL
|
||||
COMMAND ${CMAKE_COMMAND} -E touch $<TARGET_FILE:zipdir>
|
||||
DEPENDS ${ZDOOM_OUTPUT_DIR}/${PK3_NAME} )
|
||||
endif( NOT NO_GENERATOR_EXPRESSIONS )
|
||||
endfunction( add_pk3 )
|
||||
|
||||
# Macro for building libraries without debugging information
|
||||
|
|
|
@ -44,6 +44,8 @@ if(__create_launchers)
|
|||
endif()
|
||||
set(__create_launchers YES)
|
||||
|
||||
cmake_policy( SET CMP0026 OLD )
|
||||
|
||||
include(CleanDirectoryList)
|
||||
|
||||
# We must run the following at "include" time, not at function call time,
|
||||
|
@ -184,7 +186,7 @@ macro(_launcher_process_args)
|
|||
set(USERFILE_ENV_COMMANDS)
|
||||
foreach(_arg "${RUNTIME_LIBRARIES_ENVIRONMENT}" ${ENVIRONMENT})
|
||||
string(CONFIGURE
|
||||
"@USERFILE_ENVIRONMENT@@LAUNCHER_LINESEP@@_arg@"
|
||||
"${USERFILE_ENVIRONMENT}${LAUNCHER_LINESEP}${_arg}"
|
||||
USERFILE_ENVIRONMENT
|
||||
@ONLY)
|
||||
string(CONFIGURE
|
||||
|
|
|
@ -19,18 +19,16 @@ if( NOT MSVC AND NOT APPLE )
|
|||
if( NOT CMAKE_CROSSCOMPILING )
|
||||
add_executable( arithchk arithchk.c )
|
||||
endif( NOT CMAKE_CROSSCOMPILING )
|
||||
get_target_property( ARITHCHK_EXE arithchk LOCATION )
|
||||
add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/arith.h
|
||||
COMMAND ${ARITHCHK_EXE} >${CMAKE_CURRENT_BINARY_DIR}/arith.h
|
||||
COMMAND arithchk >${CMAKE_CURRENT_BINARY_DIR}/arith.h
|
||||
DEPENDS arithchk )
|
||||
|
||||
if( NOT CMAKE_CROSSCOMPILING )
|
||||
add_executable( qnan qnan.c arith.h )
|
||||
set( CROSS_EXPORTS ${CROSS_EXPORTS} arithchk qnan PARENT_SCOPE )
|
||||
endif( NOT CMAKE_CROSSCOMPILING )
|
||||
get_target_property( QNAN_EXE qnan LOCATION )
|
||||
add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/gd_qnan.h
|
||||
COMMAND ${QNAN_EXE} >${CMAKE_CURRENT_BINARY_DIR}/gd_qnan.h
|
||||
COMMAND qnan >${CMAKE_CURRENT_BINARY_DIR}/gd_qnan.h
|
||||
DEPENDS qnan )
|
||||
|
||||
set( GEN_FP_FILES arith.h gd_qnan.h )
|
||||
|
@ -44,7 +42,4 @@ add_library( gdtoa
|
|||
misc.c
|
||||
)
|
||||
target_link_libraries( gdtoa )
|
||||
if( GEN_FP_DEPS )
|
||||
add_dependencies( gdtoa ${GEN_FP_DEPS} )
|
||||
endif( GEN_FP_DEPS )
|
||||
|
||||
|
|
|
@ -504,10 +504,8 @@ endif( BACKPATCH )
|
|||
|
||||
# Update gitinfo.h
|
||||
|
||||
get_target_property( UPDATEREVISION_EXE updaterevision LOCATION )
|
||||
|
||||
add_custom_target( revision_check ALL
|
||||
COMMAND ${UPDATEREVISION_EXE} src/gitinfo.h
|
||||
COMMAND updaterevision src/gitinfo.h
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
DEPENDS updaterevision )
|
||||
|
||||
|
@ -627,17 +625,14 @@ else( NO_ASM )
|
|||
endif( X64 )
|
||||
endif( NO_ASM )
|
||||
|
||||
get_target_property( LEMON_EXE lemon LOCATION )
|
||||
get_target_property( RE2C_EXE re2c LOCATION )
|
||||
|
||||
add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xlat_parser.c ${CMAKE_CURRENT_BINARY_DIR}/xlat_parser.h
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/xlat/xlat_parser.y .
|
||||
COMMAND ${LEMON_EXE} xlat_parser.y
|
||||
COMMAND lemon xlat_parser.y
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
DEPENDS lemon ${CMAKE_CURRENT_SOURCE_DIR}/xlat/xlat_parser.y )
|
||||
|
||||
add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sc_man_scanner.h
|
||||
COMMAND ${RE2C_EXE} --no-generation-date -s -o ${CMAKE_CURRENT_BINARY_DIR}/sc_man_scanner.h ${CMAKE_CURRENT_SOURCE_DIR}/sc_man_scanner.re
|
||||
COMMAND re2c --no-generation-date -s -o ${CMAKE_CURRENT_BINARY_DIR}/sc_man_scanner.h ${CMAKE_CURRENT_SOURCE_DIR}/sc_man_scanner.re
|
||||
DEPENDS re2c ${CMAKE_CURRENT_SOURCE_DIR}/sc_man_scanner.re )
|
||||
|
||||
include_directories( ${CMAKE_CURRENT_BINARY_DIR} )
|
||||
|
|
|
@ -25,8 +25,7 @@ if( NOT CMAKE_CROSSCOMPILING )
|
|||
endif( NOT CMAKE_CROSSCOMPILING )
|
||||
|
||||
if( MT_MERGE )
|
||||
get_target_property( UPDATEREVISION_EXE updaterevision LOCATION )
|
||||
add_custom_command(TARGET updaterevision POST_BUILD
|
||||
COMMAND mt -inputresource:${UPDATEREVISION_EXE} -manifest ${CMAKE_CURRENT_SOURCE_DIR}/trustinfo.txt -outputresource:${UPDATEREVISION_EXE} -nologo
|
||||
COMMAND mt -inputresource:$<TARGET_FILE:updaterevision> -manifest ${CMAKE_CURRENT_SOURCE_DIR}/trustinfo.txt -outputresource:$<TARGET_FILE:updaterevision> -nologo
|
||||
COMMENT "Embedding trustinfo into updaterevision" )
|
||||
endif( MT_MERGE )
|
||||
|
|
Loading…
Reference in a new issue