From 72a1f8ad08fde73defe369fe92dec5e6ccc2c5b8 Mon Sep 17 00:00:00 2001 From: Taylor Richards Date: Tue, 18 Oct 2016 21:04:50 -0400 Subject: [PATCH] skip toolset building when it's a demo --- CMakeLists.txt | 319 +++++++++++++++++++++++++------------------------ 1 file changed, 162 insertions(+), 157 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ba13d7..bc795b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -225,163 +225,168 @@ endif() # toolset: targets for creating/modifying game assets # -# -# AC: anim converter -# - -add_executable(ac - EXCLUDE_FROM_ALL - ${ac_SOURCE} - ${ac_HEADERS} -) - -CreateSourceGroups(${ac_SOURCE}) - -target_link_libraries( - ac - code - ${SDL2_LIBRARY} - ${OPENGL_LIBRARIES} - ${OPENAL_LIBRARY} - ${LIBWEBSOCKETS_LIBRARIES} - ${PLATFORM_LIBRARIES} -) - -# -# CFILEARCHIVER: to create VP file archives -# - -add_executable(cfilearchiver - EXCLUDE_FROM_ALL - ${cfilearchiver_SOURCE} -) - -CreateSourceGroups(${cfilearchiver_SOURCE}) - -# -# CRYPTSTRING: string encryption (for embedded cheat codes) -# - -add_executable(cryptstring - EXCLUDE_FROM_ALL - ${cryptstring_SOURCE} -) - -CreateSourceGroups(${cryptstring_SOURCE}) - -# -# NEBEDIT: FS1 style nebula editor/creator -# - -add_executable(nebedit - EXCLUDE_FROM_ALL - WIN32 - ${nebedit_SOURCE} -) - -CreateSourceGroups(${nebedit_SOURCE}) - -target_link_libraries( - nebedit - code - ${SDL2_LIBRARY} - ${OPENGL_LIBRARIES} - ${OPENAL_LIBRARY} - ${wxWidgets_LIBRARIES} - ${LIBWEBSOCKETS_LIBRARIES} - ${PLATFORM_LIBRARIES} -) - -# wxWidgets appears to need c++11 for one or more headers -if(NOT WIN32) - set_target_properties(nebedit PROPERTIES COMPILE_FLAGS -std=c++11) -endif() - -# -# POFVIEW: model viewer -# - -add_executable(pofview - EXCLUDE_FROM_ALL - WIN32 - ${pofview_SOURCE} - ${pofview_HEADERS} -) - -CreateSourceGroups(${pofview_SOURCE}) - -target_link_libraries( - pofview - code - ${SDL2_LIBRARY} - ${OPENGL_LIBRARIES} - ${OPENAL_LIBRARY} - ${wxWidgets_LIBRARIES} - ${LIBWEBSOCKETS_LIBRARIES} - ${PLATFORM_LIBRARIES} -) - -# wxWidgets appears to need c++11 for one or more headers -if(NOT WIN32) - set_target_properties(pofview PROPERTIES COMPILE_FLAGS -std=c++11) -endif() - -# -# SCRAMBLE: file-based encryption for TBLs -# - -add_executable(scramble - EXCLUDE_FROM_ALL - ${scramble_SOURCE} - ${scramble_HEADERS} -) - -CreateSourceGroups(${scramble_SOURCE}) - -# -# FONTTOOL: create font files / edit kerning data -# - -add_executable(fonttool - EXCLUDE_FROM_ALL - ${fonttool_SOURCE} - ${fonttool_HEADERS} -) - -CreateSourceGroups(${fonttool_SOURCE}) - -# background setup, to allow running from build location without installing -add_custom_command(TARGET fonttool - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/src/fonttool" - COMMAND ${CMAKE_COMMAND} -E copy "${PROJECT_SOURCE_DIR}/src/fonttool/fonttool.pcx" "${CMAKE_CURRENT_BINARY_DIR}/src/fonttool" -) - -target_link_libraries( - fonttool - code - ${SDL2_LIBRARY} - ${OPENGL_LIBRARIES} - ${OPENAL_LIBRARY} - ${LIBWEBSOCKETS_LIBRARIES} - ${PLATFORM_LIBRARIES} -) - -# -# custom target to build all tools in one pass -# - -add_custom_target(tools) - -add_dependencies(tools - ac - cfilearchiver - cryptstring - nebedit - pofview - scramble - fonttool -) +# don't build toolset unless it's a full build +if(NOT DEMO) + + # + # AC: anim converter + # + + add_executable(ac + EXCLUDE_FROM_ALL + ${ac_SOURCE} + ${ac_HEADERS} + ) + + CreateSourceGroups(${ac_SOURCE}) + + target_link_libraries( + ac + code + ${SDL2_LIBRARY} + ${OPENGL_LIBRARIES} + ${OPENAL_LIBRARY} + ${LIBWEBSOCKETS_LIBRARIES} + ${PLATFORM_LIBRARIES} + ) + + # + # CFILEARCHIVER: to create VP file archives + # + + add_executable(cfilearchiver + EXCLUDE_FROM_ALL + ${cfilearchiver_SOURCE} + ) + + CreateSourceGroups(${cfilearchiver_SOURCE}) + + # + # CRYPTSTRING: string encryption (for embedded cheat codes) + # + + add_executable(cryptstring + EXCLUDE_FROM_ALL + ${cryptstring_SOURCE} + ) + + CreateSourceGroups(${cryptstring_SOURCE}) + + # + # NEBEDIT: FS1 style nebula editor/creator + # + + add_executable(nebedit + EXCLUDE_FROM_ALL + WIN32 + ${nebedit_SOURCE} + ) + + CreateSourceGroups(${nebedit_SOURCE}) + + target_link_libraries( + nebedit + code + ${SDL2_LIBRARY} + ${OPENGL_LIBRARIES} + ${OPENAL_LIBRARY} + ${wxWidgets_LIBRARIES} + ${LIBWEBSOCKETS_LIBRARIES} + ${PLATFORM_LIBRARIES} + ) + + # wxWidgets appears to need c++11 for one or more headers + if(NOT WIN32) + set_target_properties(nebedit PROPERTIES COMPILE_FLAGS -std=c++11) + endif() + + # + # POFVIEW: model viewer + # + + add_executable(pofview + EXCLUDE_FROM_ALL + WIN32 + ${pofview_SOURCE} + ${pofview_HEADERS} + ) + + CreateSourceGroups(${pofview_SOURCE}) + + target_link_libraries( + pofview + code + ${SDL2_LIBRARY} + ${OPENGL_LIBRARIES} + ${OPENAL_LIBRARY} + ${wxWidgets_LIBRARIES} + ${LIBWEBSOCKETS_LIBRARIES} + ${PLATFORM_LIBRARIES} + ) + + # wxWidgets appears to need c++11 for one or more headers + if(NOT WIN32) + set_target_properties(pofview PROPERTIES COMPILE_FLAGS -std=c++11) + endif() + + # + # SCRAMBLE: file-based encryption for TBLs + # + + add_executable(scramble + EXCLUDE_FROM_ALL + ${scramble_SOURCE} + ${scramble_HEADERS} + ) + + CreateSourceGroups(${scramble_SOURCE}) + + # + # FONTTOOL: create font files / edit kerning data + # + + add_executable(fonttool + EXCLUDE_FROM_ALL + ${fonttool_SOURCE} + ${fonttool_HEADERS} + ) + + CreateSourceGroups(${fonttool_SOURCE}) + + # background setup, to allow running from build location without installing + add_custom_command(TARGET fonttool + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/src/fonttool" + COMMAND ${CMAKE_COMMAND} -E copy "${PROJECT_SOURCE_DIR}/src/fonttool/fonttool.pcx" "${CMAKE_CURRENT_BINARY_DIR}/src/fonttool" + ) + + target_link_libraries( + fonttool + code + ${SDL2_LIBRARY} + ${OPENGL_LIBRARIES} + ${OPENAL_LIBRARY} + ${LIBWEBSOCKETS_LIBRARIES} + ${PLATFORM_LIBRARIES} + ) + + # + # custom target to build all tools in one pass + # + + add_custom_target(tools) + + add_dependencies(tools + ac + cfilearchiver + cryptstring + nebedit + pofview + scramble + fonttool + ) + +endif(NOT DEMO) # # ############################################################################## -- 2.39.2