mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 06:41:59 +00:00
- put the project's name into a variable so that it doesn't have to be changed everywhere if needed.
This commit is contained in:
parent
5a853cb196
commit
6b0711ff0c
2 changed files with 26 additions and 25 deletions
|
@ -1,5 +1,6 @@
|
|||
cmake_minimum_required( VERSION 3.1.0 )
|
||||
project(Demolition)
|
||||
set ( PROJECT_NAME "demolition")
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
@ -79,7 +80,7 @@ function( add_pk3 PK3_NAME PK3_DIR )
|
|||
if( NOT COMPILE_OUTPUT_OLDSTYLE )
|
||||
add_custom_command( OUTPUT ${COMPILE_OUTPUT_DIECTRORY}/${PK3_NAME}
|
||||
COMMAND zipdir -udf ${PK3_ZIPDIR_OPTIONS} ${COMPILE_OUTPUT_DIECTRORY}/${PK3_NAME} ${PK3_DIR}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${COMPILE_OUTPUT_DIECTRORY}/${PK3_NAME} $<TARGET_FILE_DIR:demolition>/${PK3_NAME}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${COMPILE_OUTPUT_DIECTRORY}/${PK3_NAME} $<TARGET_FILE_DIR:${PROJECT_NAME}>/${PK3_NAME}
|
||||
DEPENDS zipdir )
|
||||
else()
|
||||
add_custom_command( OUTPUT ${COMPILE_OUTPUT_DIECTRORY}/${PK3_NAME}
|
||||
|
@ -141,7 +142,7 @@ IF( NOT CMAKE_BUILD_TYPE )
|
|||
ENDIF()
|
||||
|
||||
set( COMPILE_OUTPUT_DIECTRORY ${CMAKE_BINARY_DIR} CACHE PATH "Directory where engine data and the executable will be created." )
|
||||
set( COMPILE_EXE_NAME "demolition" CACHE FILEPATH "Name of the executable to create" )
|
||||
set( COMPILE_EXE_NAME ${PROJECT_NAME} CACHE FILEPATH "Name of the executable to create" )
|
||||
if( MSVC )
|
||||
# Allow the user to use COMPILE_OUTPUT_DIECTRORY as a single release point.
|
||||
# Use different names for the various compile targets.
|
||||
|
|
|
@ -526,7 +526,7 @@ elseif( APPLE )
|
|||
|
||||
set( SYSTEM_SOURCES ${SYSTEM_SOURCES} ${PLAT_POSIX_SOURCES} ${PLAT_OSX_SOURCES} )
|
||||
|
||||
##set_source_files_properties( posix/osx/demolition.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources )
|
||||
##set_source_files_properties( posix/osx/${PROJECT_NAME}.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources )
|
||||
##set_source_files_properties( posix/osx/iwadpicker_cocoa.mm PROPERTIES COMPILE_FLAGS -fobjc-exceptions )
|
||||
else()
|
||||
#set( SYSTEM_SOURCES_DIR posix posix/sdl )
|
||||
|
@ -829,7 +829,7 @@ else()
|
|||
set_source_files_properties( ${PCH_SOURCES} PROPERTIES COMPILE_FLAGS "-include g_pch.h" )
|
||||
endif()
|
||||
|
||||
add_executable( demolition WIN32 MACOSX_BUNDLE
|
||||
add_executable( ${PROJECT_NAME} WIN32 MACOSX_BUNDLE
|
||||
${HEADER_FILES}
|
||||
${NOT_COMPILED_SOURCE_FILES}
|
||||
#__autostart.cpp
|
||||
|
@ -859,7 +859,7 @@ if( UNIX )
|
|||
endif()
|
||||
endif()
|
||||
|
||||
target_link_libraries( demolition ${PROJECT_LIBRARIES} gdtoa lzma duke3d blood rr sw zmusic )
|
||||
target_link_libraries( ${PROJECT_NAME} ${PROJECT_LIBRARIES} gdtoa lzma duke3d blood rr sw zmusic )
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
|
@ -893,23 +893,23 @@ include_directories(
|
|||
#${SYSTEM_SOURCES_DIR}
|
||||
)
|
||||
|
||||
add_dependencies( demolition revision_check )
|
||||
add_dependencies( ${PROJECT_NAME} revision_check )
|
||||
|
||||
# Due to some quirks, we need to do this in this order
|
||||
if( NOT COMPILE_OUTPUT_OLDSTYLE )
|
||||
# RUNTIME_OUTPUT_DIRECTORY does not exist in CMake 2.4.
|
||||
# Linux distributions are slow to adopt 2.6. :(
|
||||
set_target_properties( demolition PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${COMPILE_OUTPUT_DIECTRORY} )
|
||||
set_target_properties( demolition PROPERTIES OUTPUT_NAME ${EXECUTABLE_NAME} )
|
||||
set_target_properties( ${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${COMPILE_OUTPUT_DIECTRORY} )
|
||||
set_target_properties( ${PROJECT_NAME} PROPERTIES OUTPUT_NAME ${PROJECT_NAME} )
|
||||
else()
|
||||
set_target_properties( demolition PROPERTIES
|
||||
RUNTIME_OUTPUT_NAME ${EXECUTABLE_NAME}
|
||||
set_target_properties( ${PROJECT_NAME} PROPERTIES
|
||||
RUNTIME_OUTPUT_NAME ${PROJECT_NAME}
|
||||
RUNTIME_OUTPUT_DIRECTORY_RELEASE ${COMPILE_OUTPUT_DIECTRORY}
|
||||
RUNTIME_OUTPUT_NAME_DEBUG ${EXECUTABLE_NAME}d
|
||||
RUNTIME_OUTPUT_NAME_DEBUG ${PROJECT_NAME}d
|
||||
RUNTIME_OUTPUT_DIRECTORY_DEBUG ${COMPILE_OUTPUT_DIECTRORY}
|
||||
RUNTIME_OUTPUT_NAME_MINSIZEREL ${EXECUTABLE_NAME}msr
|
||||
RUNTIME_OUTPUT_NAME_MINSIZEREL ${PROJECT_NAME}msr
|
||||
RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${COMPILE_OUTPUT_DIECTRORY}
|
||||
RUNTIME_OUTPUT_NAME_RELWITHDEBINFO ${EXECUTABLE_NAME}rd
|
||||
RUNTIME_OUTPUT_NAME_RELWITHDEBINFO ${PROJECT_NAME}rd
|
||||
RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${COMPILE_OUTPUT_DIECTRORY}
|
||||
)
|
||||
endif()
|
||||
|
@ -921,29 +921,29 @@ if( MSVC )
|
|||
if( COMPILE_GENERATE_MAPFILE )
|
||||
set( LINKERSTUFF "${LINKERSTUFF} /MAP" )
|
||||
endif()
|
||||
set_target_properties(demolition PROPERTIES LINK_FLAGS ${LINKERSTUFF})
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS ${LINKERSTUFF})
|
||||
|
||||
add_custom_command(TARGET demolition POST_BUILD
|
||||
COMMAND "mt.exe" -manifest \"${CMAKE_CURRENT_SOURCE_DIR}\\platform\\win32\\manifest.game.xml\" -outputresource:\"$<TARGET_FILE:demolition>\"\;\#1
|
||||
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
||||
COMMAND "mt.exe" -manifest \"${CMAKE_CURRENT_SOURCE_DIR}\\platform\\win32\\manifest.game.xml\" -outputresource:\"$<TARGET_FILE:${PROJECT_NAME}>\"\;\#1
|
||||
COMMENT "Adding manifest..."
|
||||
)
|
||||
|
||||
endif()
|
||||
|
||||
if( NOT WIN32 AND NOT APPLE )
|
||||
FILE( WRITE ${CMAKE_CURRENT_BINARY_DIR}/link-make "if [ ! -e ${COMPILE_OUTPUT_DIECTRORY}/${EXECUTABLE_NAME} ]; then ln -sf ${CMAKE_CURRENT_BINARY_DIR}/${EXECUTABLE_NAME} ${COMPILE_OUTPUT_DIECTRORY}/${EXECUTABLE_NAME}; fi" )
|
||||
add_custom_command( TARGET demolition POST_BUILD
|
||||
FILE( WRITE ${CMAKE_CURRENT_BINARY_DIR}/link-make "if [ ! -e ${COMPILE_OUTPUT_DIECTRORY}/${PROJECT_NAME} ]; then ln -sf ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME} ${COMPILE_OUTPUT_DIECTRORY}/${PROJECT_NAME}; fi" )
|
||||
add_custom_command( TARGET ${PROJECT_NAME} POST_BUILD
|
||||
COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/link-make
|
||||
COMMAND /bin/sh -c ${CMAKE_CURRENT_BINARY_DIR}/link-make )
|
||||
endif()
|
||||
|
||||
#add_custom_command(TARGET demolition POST_BUILD
|
||||
#add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
||||
# COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
# ${CMAKE_SOURCE_DIR}/soundfont/demolition.sf2 $<TARGET_FILE_DIR:demolition>/soundfonts/demolition.sf2
|
||||
# ${CMAKE_SOURCE_DIR}/soundfont/${PROJECT_NAME}.sf2 $<TARGET_FILE_DIR:${PROJECT_NAME}>/soundfonts/${PROJECT_NAME}.sf2
|
||||
# COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
# ${CMAKE_SOURCE_DIR}/fm_banks/GENMIDI.GS.wopl $<TARGET_FILE_DIR:demolition>/fm_banks/GENMIDI.GS.wopl
|
||||
# ${CMAKE_SOURCE_DIR}/fm_banks/GENMIDI.GS.wopl $<TARGET_FILE_DIR:${PROJECT_NAME}>/fm_banks/GENMIDI.GS.wopl
|
||||
# COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
# ${CMAKE_SOURCE_DIR}/fm_banks/gs-by-papiezak-and-sneakernets.wopn $<TARGET_FILE_DIR:demolition>/fm_banks/gs-by-papiezak-and-sneakernets.wopn
|
||||
# ${CMAKE_SOURCE_DIR}/fm_banks/gs-by-papiezak-and-sneakernets.wopn $<TARGET_FILE_DIR:${PROJECT_NAME}>/fm_banks/gs-by-papiezak-and-sneakernets.wopn
|
||||
#)
|
||||
|
||||
if( CMAKE_COMPILER_IS_GNUCXX )
|
||||
|
@ -958,9 +958,9 @@ if( APPLE )
|
|||
set( LINK_FRAMEWORKS "${LINK_FRAMEWORKS} -framework QuartzCore" )
|
||||
endif()
|
||||
|
||||
set_target_properties(demolition PROPERTIES
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES
|
||||
LINK_FLAGS "${LINK_FRAMEWORKS}"
|
||||
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/posix/osx/demolition-info.plist" )
|
||||
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/posix/osx/${PROJECT_NAME}-info.plist" )
|
||||
|
||||
# Dymanic libraries like libvulkan.dylib or libMoltenVK.dylib will be loaded by dlopen()
|
||||
# if placed in the directory with the main executable
|
||||
|
@ -972,7 +972,7 @@ if( WIN32 )
|
|||
else()
|
||||
set( INSTALL_PATH bin CACHE STRING "Directory where the executable will be placed during install." )
|
||||
endif()
|
||||
install(TARGETS demolition
|
||||
install(TARGETS ${PROJECT_NAME}
|
||||
DESTINATION ${INSTALL_PATH}
|
||||
COMPONENT "Game executable")
|
||||
|
||||
|
|
Loading…
Reference in a new issue