- renamed internal CMake variables to not contain the project name.

This commit is contained in:
Christoph Oelckers 2019-12-27 13:37:39 +01:00
parent aefb3ec216
commit b307db2346
3 changed files with 71 additions and 86 deletions

View file

@ -76,21 +76,21 @@ function( add_pk3 PK3_NAME PK3_DIR )
# Generate target name. Just use "pk3" for main pk3 target. # Generate target name. Just use "pk3" for main pk3 target.
string( REPLACE "." "_" PK3_TARGET ${PK3_NAME} ) string( REPLACE "." "_" PK3_TARGET ${PK3_NAME} )
if( NOT DEMOLITION_OUTPUT_OLDSTYLE ) if( NOT COMPILE_OUTPUT_OLDSTYLE )
add_custom_command( OUTPUT ${DEMOLITION_OUTPUT_DIR}/${PK3_NAME} add_custom_command( OUTPUT ${COMPILE_OUTPUT_DIECTRORY}/${PK3_NAME}
COMMAND zipdir -udf ${PK3_ZIPDIR_OPTIONS} ${DEMOLITION_OUTPUT_DIR}/${PK3_NAME} ${PK3_DIR} COMMAND zipdir -udf ${PK3_ZIPDIR_OPTIONS} ${COMPILE_OUTPUT_DIECTRORY}/${PK3_NAME} ${PK3_DIR}
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${DEMOLITION_OUTPUT_DIR}/${PK3_NAME} $<TARGET_FILE_DIR:demolition>/${PK3_NAME} COMMAND ${CMAKE_COMMAND} -E copy_if_different ${COMPILE_OUTPUT_DIECTRORY}/${PK3_NAME} $<TARGET_FILE_DIR:demolition>/${PK3_NAME}
DEPENDS zipdir ) DEPENDS zipdir )
else() else()
add_custom_command( OUTPUT ${DEMOLITION_OUTPUT_DIR}/${PK3_NAME} add_custom_command( OUTPUT ${COMPILE_OUTPUT_DIECTRORY}/${PK3_NAME}
COMMAND zipdir -udf ${PK3_ZIPDIR_OPTIONS} ${DEMOLITION_OUTPUT_DIR}/${PK3_NAME} ${PK3_DIR} COMMAND zipdir -udf ${PK3_ZIPDIR_OPTIONS} ${COMPILE_OUTPUT_DIECTRORY}/${PK3_NAME} ${PK3_DIR}
DEPENDS zipdir ) DEPENDS zipdir )
endif() endif()
# Create a list of source files for this PK3, for use in the IDE # Create a list of source files for this PK3, for use in the IDE
# Phase 1: Create a list of all source files for this PK3 archive, except # Phase 1: Create a list of all source files for this PK3 archive, except
# for a couple of strife image file names that confuse CMake. # for a couple of strife image file names that confuse CMake.
file(GLOB_RECURSE PK3_SRCS ${PK3_DIR}/*) file(GLOB_RECURSE PK3_SRCS ${PK3_DIR}/*)
# Exclude from the source list some demolition .png files with brackets in the # Exclude from the source list some files with brackets in the
# file names here, because they confuse CMake. # file names here, because they confuse CMake.
# This only affects the list of source files shown in the IDE. # This only affects the list of source files shown in the IDE.
# It does not actually remove the files from the PK3 archive. # It does not actually remove the files from the PK3 archive.
@ -109,7 +109,7 @@ function( add_pk3 PK3_NAME PK3_DIR )
# rebuild each time since their dependency has "changed." # rebuild each time since their dependency has "changed."
add_custom_target( ${PK3_TARGET} ALL add_custom_target( ${PK3_TARGET} ALL
COMMAND ${CMAKE_COMMAND} -E touch $<TARGET_FILE:zipdir> COMMAND ${CMAKE_COMMAND} -E touch $<TARGET_FILE:zipdir>
DEPENDS ${DEMOLITION_OUTPUT_DIR}/${PK3_NAME} DEPENDS ${COMPILE_OUTPUT_DIECTRORY}/${PK3_NAME}
SOURCES ${PK3_SRCS}) SOURCES ${PK3_SRCS})
# Phase 3: Assign source files to a nice folder structure in the IDE # Phase 3: Assign source files to a nice folder structure in the IDE
assort_pk3_source_folder("Source Files" ${PK3_DIR}) assort_pk3_source_folder("Source Files" ${PK3_DIR})
@ -140,14 +140,14 @@ IF( NOT CMAKE_BUILD_TYPE )
FORCE ) FORCE )
ENDIF() ENDIF()
set( DEMOLITION_OUTPUT_DIR ${CMAKE_BINARY_DIR} CACHE PATH "Directory where engine data and the executable will be created." ) set( COMPILE_OUTPUT_DIECTRORY ${CMAKE_BINARY_DIR} CACHE PATH "Directory where engine data and the executable will be created." )
set( DEMOLITION_EXE_NAME "demolition" CACHE FILEPATH "Name of the executable to create" ) set( COMPILE_EXE_NAME "demolition" CACHE FILEPATH "Name of the executable to create" )
if( MSVC ) if( MSVC )
# Allow the user to use DEMOLITION_OUTPUT_DIR as a single release point. # Allow the user to use COMPILE_OUTPUT_DIECTRORY as a single release point.
# Use demolition, demolitiond, demolition64, and demolitiond64 for the binary names # Use different names for the various compile targets.
option( DEMOLITION_OUTPUT_OLDSTYLE "Don't use Release/Debug directories." OFF ) option( COMPILE_OUTPUT_OLDSTYLE "Don't use Release/Debug directories." OFF )
else() else()
set( DEMOLITION_OUTPUT_OLDSTYLE OFF ) set( COMPILE_OUTPUT_OLDSTYLE OFF )
endif() endif()
# Replacement variables for a possible long list of C/C++ compilers compatible with GCC # Replacement variables for a possible long list of C/C++ compilers compatible with GCC
@ -176,7 +176,7 @@ find_package( ZLIB )
include( TargetArch ) include( TargetArch )
# Things for later. Currently we have no VM and no Vulkan # Things for later. Currently we have no VM and no Vulkan
#if( ${DEMOLITION_TARGET_ARCH} MATCHES "x86_64" ) #if( ${TARGET_ARCHITECTURE} MATCHES "x86_64" )
# set( HAVE_VM_JIT ON ) # set( HAVE_VM_JIT ON )
# option (HAVE_VULKAN "Enable Vulkan support" ON) # option (HAVE_VULKAN "Enable Vulkan support" ON)
#endif() #endif()
@ -208,8 +208,8 @@ if( MSVC )
# Avoid CRT DLL dependancies in release builds, optionally generate assembly output for checking crash locations. # Avoid CRT DLL dependancies in release builds, optionally generate assembly output for checking crash locations.
option( DEMOLITION_GENERATE_ASM "Generate assembly output." OFF ) option( COMPILE_GENERATE_ASM "Generate assembly output." OFF )
if( DEMOLITION_GENERATE_ASM ) if( COMPILE_GENERATE_ASM )
set( REL_C_FLAGS "/MT /Oy /Oi /FAcs /GS-" ) set( REL_C_FLAGS "/MT /Oy /Oi /FAcs /GS-" )
else() else()
set( REL_C_FLAGS "/MT /Oy /Oi /GS-" ) set( REL_C_FLAGS "/MT /Oy /Oi /GS-" )
@ -323,7 +323,7 @@ if( ZLIB_FOUND AND NOT FORCE_INTERNAL_ZLIB )
message( STATUS "Using system zlib, includes found at ${ZLIB_INCLUDE_DIR}" ) message( STATUS "Using system zlib, includes found at ${ZLIB_INCLUDE_DIR}" )
else() else()
message( STATUS "Using internal zlib" ) message( STATUS "Using internal zlib" )
set( SKIP_INSTALL_ALL TRUE ) # Avoid installing zlib alongside demolition set( SKIP_INSTALL_ALL TRUE ) # Avoid installing zlib
add_subdirectory( libraries/zlib ) add_subdirectory( libraries/zlib )
set( ZLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libraries/zlib ) set( ZLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libraries/zlib )
set( ZLIB_LIBRARIES z ) set( ZLIB_LIBRARIES z )
@ -348,7 +348,7 @@ endif()
# message( STATUS "Using system asmjit, includes found at ${ASMJIT_INCLUDE_DIR}" ) # message( STATUS "Using system asmjit, includes found at ${ASMJIT_INCLUDE_DIR}" )
# else() # else()
# message( STATUS "Using internal asmjit" ) # message( STATUS "Using internal asmjit" )
# set( SKIP_INSTALL_ALL TRUE ) # Avoid installing asmjit alongside demolition # set( SKIP_INSTALL_ALL TRUE ) # Avoid installing asmjit
# add_subdirectory( libraries/asmjit ) # add_subdirectory( libraries/asmjit )
# set( ASMJIT_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libraries/asmjit ) # set( ASMJIT_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libraries/asmjit )
# set( ASMJIT_LIBRARIES asmjit ) # set( ASMJIT_LIBRARIES asmjit )
@ -393,7 +393,7 @@ endif()
#if( WIN32 ) #if( WIN32 )
# set( INSTALL_DOCS_PATH docs CACHE STRING "Directory where the documentation will be placed during install." ) # set( INSTALL_DOCS_PATH docs CACHE STRING "Directory where the documentation will be placed during install." )
#else() #else()
# set( INSTALL_DOCS_PATH share/doc/${DEMOLITION_EXE_NAME} CACHE STRING "Directory where the demolition documentation will be placed during install." ) # set( INSTALL_DOCS_PATH share/doc/${COMPILE_EXE_NAME} CACHE STRING "Directory where the documentation will be placed during install." )
#endif() #endif()
#install(DIRECTORY docs/ #install(DIRECTORY docs/
# DESTINATION ${INSTALL_DOCS_PATH} # DESTINATION ${INSTALL_DOCS_PATH}

View file

@ -36,20 +36,20 @@ if( APPLE )
option( OSX_COCOA_BACKEND "Use native Cocoa backend instead of SDL" ON ) option( OSX_COCOA_BACKEND "Use native Cocoa backend instead of SDL" ON )
endif() endif()
target_architecture(DEMOLITION_TARGET_ARCH) target_architecture(TARGET_ARCHITECTURE)
message(STATUS "Architecture is ${DEMOLITION_TARGET_ARCH}") message(STATUS "Architecture is ${TARGET_ARCHITECTURE}")
# Right now only 64 bit is supported. # Right now only 64 bit is supported.
if( ${DEMOLITION_TARGET_ARCH} MATCHES "x86_64" ) if( ${TARGET_ARCHITECTURE} MATCHES "x86_64" )
set( X64 64 ) set( X64 64 )
endif() endif()
if( X64 OR ${DEMOLITION_TARGET_ARCH} MATCHES "i386" ) if( X64 OR ${TARGET_ARCHITECTURE} MATCHES "i386" )
add_definitions( -DARCH_IA32 ) add_definitions( -DARCH_IA32 )
endif() endif()
if( NOT DEMOLITION_LIBS ) if( NOT PROJECT_LIBRARIES )
set( DEMOLITION_LIBS "" ) set( PROJECT_LIBRARIES "" )
endif() endif()
if( WIN32 ) if( WIN32 )
@ -72,7 +72,7 @@ if( WIN32 )
link_directories(${CMAKE_CURRENT_SOURCE_DIR}/../platform/Windows/lib/32) link_directories(${CMAKE_CURRENT_SOURCE_DIR}/../platform/Windows/lib/32)
endif() endif()
set( DEMOLITION_LIBS set( PROJECT_LIBRARIES
opengl32 opengl32
wsock32 wsock32
winmm winmm
@ -111,12 +111,12 @@ if( WIN32 )
if( NOT DEM_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE ) if( NOT DEM_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE )
set( DEMOLITION_LIBS ${DEMOLITION_LIBS} DelayImp ) set( PROJECT_LIBRARIES ${PROJECT_LIBRARIES} DelayImp )
endif() endif()
if( DEM_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE ) if( DEM_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE )
if( DX_dxguid_LIBRARY ) if( DX_dxguid_LIBRARY )
list( APPEND DEMOLITION_LIBS "${DX_dxguid_LIBRARY}" ) list( APPEND PROJECT_LIBRARIES "${DX_dxguid_LIBRARY}" )
endif() endif()
endif() endif()
else() else()
@ -138,7 +138,7 @@ else()
pkg_check_modules( GTK3 gtk+-3.0 ) pkg_check_modules( GTK3 gtk+-3.0 )
if( GTK3_FOUND ) if( GTK3_FOUND )
if( NOT DYN_GTK ) if( NOT DYN_GTK )
set( DEMOLITION_LIBS ${DEMOLITION_LIBS} ${GTK3_LIBRARIES} ) set( PROJECT_LIBRARIES ${PROJECT_LIBRARIES} ${GTK3_LIBRARIES} )
endif() endif()
include_directories( ${GTK3_INCLUDE_DIRS} ) include_directories( ${GTK3_INCLUDE_DIRS} )
link_directories( ${GTK3_LIBRARY_DIRS} ) link_directories( ${GTK3_LIBRARY_DIRS} )
@ -146,7 +146,7 @@ else()
pkg_check_modules( GTK2 gtk+-2.0 ) pkg_check_modules( GTK2 gtk+-2.0 )
if( GTK2_FOUND ) if( GTK2_FOUND )
if( NOT DYN_GTK ) if( NOT DYN_GTK )
set( DEMOLITION_LIBS ${DEMOLITION_LIBS} ${GTK2_LIBRARIES} ) set( PROJECT_LIBRARIES ${PROJECT_LIBRARIES} ${GTK2_LIBRARIES} )
endif() endif()
include_directories( ${GTK2_INCLUDE_DIRS} ) include_directories( ${GTK2_INCLUDE_DIRS} )
link_directories( ${GTK2_LIBRARY_DIRS} ) link_directories( ${GTK2_LIBRARY_DIRS} )
@ -169,7 +169,7 @@ else()
if( NOT APPLE OR NOT OSX_COCOA_BACKEND ) if( NOT APPLE OR NOT OSX_COCOA_BACKEND )
find_package( SDL2 REQUIRED ) find_package( SDL2 REQUIRED )
include_directories( "${SDL2_INCLUDE_DIR}" ) include_directories( "${SDL2_INCLUDE_DIR}" )
set( DEMOLITION_LIBS ${DEMOLITION_LIBS} "${SDL2_LIBRARY}" ) set( PROJECT_LIBRARIES ${PROJECT_LIBRARIES} "${SDL2_LIBRARY}" )
endif() endif()
find_path( FPU_CONTROL_DIR fpu_control.h ) find_path( FPU_CONTROL_DIR fpu_control.h )
@ -187,7 +187,7 @@ if( NOT NO_OPENAL )
include_directories( ${OPENAL_INCLUDE_DIR} ) include_directories( ${OPENAL_INCLUDE_DIR} )
mark_as_advanced(CLEAR OPENAL_LIBRARY) mark_as_advanced(CLEAR OPENAL_LIBRARY)
if( OPENAL_LIBRARY ) if( OPENAL_LIBRARY )
set( DEMOLITION_LIBS ${OPENAL_LIBRARY} ${DEMOLITION_LIBS} ) set( PROJECT_LIBRARIES ${OPENAL_LIBRARY} ${PROJECT_LIBRARIES} )
else() else()
set( NO_OPENAL ON ) set( NO_OPENAL ON )
endif() endif()
@ -224,23 +224,16 @@ find_package( FluidSynth )
# Decide on SSE setup # Decide on SSE setup
set( SSE_MATTERS NO ) # SSE only matters on 32-bit targets. We check compiler flags to know if we can do it.
if( CMAKE_SIZEOF_VOID_P MATCHES "4" AND NOT CMAKE_OSX_ARCHITECTURES MATCHES ppc )
# with global use of SSE 2 we do not need special handling for selected files
if (NOT DEMOLITION_USE_SSE2)
# SSE only matters on 32-bit targets. We check compiler flags to know if we can do it.
if( CMAKE_SIZEOF_VOID_P MATCHES "4" AND NOT CMAKE_OSX_ARCHITECTURES MATCHES ppc )
CHECK_CXX_COMPILER_FLAG( "-msse2 -mfpmath=sse" CAN_DO_MFPMATH ) CHECK_CXX_COMPILER_FLAG( "-msse2 -mfpmath=sse" CAN_DO_MFPMATH )
CHECK_CXX_COMPILER_FLAG( -arch:SSE2 CAN_DO_ARCHSSE2 ) CHECK_CXX_COMPILER_FLAG( -arch:SSE2 CAN_DO_ARCHSSE2 )
if( CAN_DO_MFPMATH ) if( CAN_DO_MFPMATH )
set( SSE1_ENABLE "-msse -mfpmath=sse" ) set( SSE1_ENABLE "-msse -mfpmath=sse" )
set( SSE2_ENABLE "-msse2 -mfpmath=sse" ) set( SSE2_ENABLE "-msse2 -mfpmath=sse" )
set( SSE_MATTERS YES )
elseif( CAN_DO_ARCHSSE2 ) elseif( CAN_DO_ARCHSSE2 )
set( SSE1_ENABLE -arch:SSE ) set( SSE1_ENABLE -arch:SSE )
set( SSE2_ENABLE -arch:SSE2 ) set( SSE2_ENABLE -arch:SSE2 )
set( SSE_MATTERS YES )
endif()
endif() endif()
endif() endif()
@ -416,7 +409,7 @@ if( UNIX )
add_definitions( -DNO_CLOCK_GETTIME ) add_definitions( -DNO_CLOCK_GETTIME )
endif() endif()
else() else()
set( DEMOLITION_LIBS ${DEMOLITION_LIBS} rt ) set( PROJECT_LIBRARIES ${PROJECT_LIBRARIES} rt )
endif() endif()
endif() endif()
@ -432,9 +425,9 @@ add_custom_target( revision_check ALL
# required libraries # required libraries
message( STATUS "Fluid synth libs: ${FLUIDSYNTH_LIBRARIES}" ) message( STATUS "Fluid synth libs: ${FLUIDSYNTH_LIBRARIES}" )
set( DEMOLITION_LIBS ${DEMOLITION_LIBS} "${ZLIB_LIBRARIES}" "${JPEG_LIBRARIES}" "${BZIP2_LIBRARIES}" "${GME_LIBRARIES}" "${CMAKE_DL_LIBS}" ) set( PROJECT_LIBRARIES ${PROJECT_LIBRARIES} "${ZLIB_LIBRARIES}" "${JPEG_LIBRARIES}" "${BZIP2_LIBRARIES}" "${GME_LIBRARIES}" "${CMAKE_DL_LIBS}" )
if (HAVE_VULKAN) if (HAVE_VULKAN)
set( DEMOLITION_LIBS ${DEMOLITION_LIBS} "glslang" "SPIRV" "OGLCompiler") set( PROJECT_LIBRARIES ${PROJECT_LIBRARIES} "glslang" "SPIRV" "OGLCompiler")
endif() endif()
# Ugh... These precompiled dependencies need to go. # Ugh... These precompiled dependencies need to go.
@ -448,20 +441,20 @@ endif()
if( ${HAVE_VM_JIT} ) if( ${HAVE_VM_JIT} )
add_definitions( -DHAVE_VM_JIT ) add_definitions( -DHAVE_VM_JIT )
include_directories( "${ASMJIT_INCLUDE_DIR}" ) include_directories( "${ASMJIT_INCLUDE_DIR}" )
set( DEMOLITION_LIBS ${DEMOLITION_LIBS} "${ASMJIT_LIBRARIES}") set( PROJECT_LIBRARIES ${PROJECT_LIBRARIES} "${ASMJIT_LIBRARIES}")
endif() endif()
if( SNDFILE_FOUND ) if( SNDFILE_FOUND )
set( DEMOLITION_LIBS ${DEMOLITION_LIBS} "${SNDFILE_LIBRARIES}" ) set( PROJECT_LIBRARIES ${PROJECT_LIBRARIES} "${SNDFILE_LIBRARIES}" )
include_directories( "${SNDFILE_INCLUDE_DIRS}" ) include_directories( "${SNDFILE_INCLUDE_DIRS}" )
endif() endif()
if( MPG123_FOUND ) if( MPG123_FOUND )
set( DEMOLITION_LIBS ${DEMOLITION_LIBS} "${MPG123_LIBRARIES}" ) set( PROJECT_LIBRARIES ${PROJECT_LIBRARIES} "${MPG123_LIBRARIES}" )
include_directories( "${MPG123_INCLUDE_DIR}" ) include_directories( "${MPG123_INCLUDE_DIR}" )
endif() endif()
if( NOT DYN_FLUIDSYNTH ) if( NOT DYN_FLUIDSYNTH )
if( FLUIDSYNTH_FOUND ) if( FLUIDSYNTH_FOUND )
set( DEMOLITION_LIBS ${DEMOLITION_LIBS} "${FLUIDSYNTH_LIBRARIES}" ) set( PROJECT_LIBRARIES ${PROJECT_LIBRARIES} "${FLUIDSYNTH_LIBRARIES}" )
include_directories( "${FLUIDSYNTH_INCLUDE_DIR}" ) include_directories( "${FLUIDSYNTH_INCLUDE_DIR}" )
endif() endif()
endif() endif()
@ -856,17 +849,17 @@ set_source_files_properties( ${NOT_COMPILED_SOURCE_FILES} PROPERTIES HEADER_FILE
if(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS") if(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS")
# [BL] Solaris requires these to be explicitly linked. # [BL] Solaris requires these to be explicitly linked.
set( DEMOLITION_LIBS ${DEMOLITION_LIBS} nsl socket) set( PROJECT_LIBRARIES ${PROJECT_LIBRARIES} nsl socket)
endif() endif()
if( UNIX ) if( UNIX )
find_package( Backtrace ) find_package( Backtrace )
if(Backtrace_FOUND) if(Backtrace_FOUND)
set( DEMOLITION_LIBS ${DEMOLITION_LIBS} ${Backtrace_LIBRARIES} ) set( PROJECT_LIBRARIES ${PROJECT_LIBRARIES} ${Backtrace_LIBRARIES} )
endif() endif()
endif() endif()
target_link_libraries( demolition ${DEMOLITION_LIBS} gdtoa lzma duke3d blood rr sw zmusic ) target_link_libraries( demolition ${PROJECT_LIBRARIES} gdtoa lzma duke3d blood rr sw zmusic )
include_directories( include_directories(
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
@ -903,29 +896,29 @@ include_directories(
add_dependencies( demolition revision_check ) add_dependencies( demolition revision_check )
# Due to some quirks, we need to do this in this order # Due to some quirks, we need to do this in this order
if( NOT DEMOLITION_OUTPUT_OLDSTYLE ) if( NOT COMPILE_OUTPUT_OLDSTYLE )
# RUNTIME_OUTPUT_DIRECTORY does not exist in CMake 2.4. # RUNTIME_OUTPUT_DIRECTORY does not exist in CMake 2.4.
# Linux distributions are slow to adopt 2.6. :( # Linux distributions are slow to adopt 2.6. :(
set_target_properties( demolition PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${DEMOLITION_OUTPUT_DIR} ) set_target_properties( demolition PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${COMPILE_OUTPUT_DIECTRORY} )
set_target_properties( demolition PROPERTIES OUTPUT_NAME ${DEMOLITION_EXE_NAME} ) set_target_properties( demolition PROPERTIES OUTPUT_NAME ${EXECUTABLE_NAME} )
else() else()
set_target_properties( demolition PROPERTIES set_target_properties( demolition PROPERTIES
RUNTIME_OUTPUT_NAME ${DEMOLITION_EXE_NAME} RUNTIME_OUTPUT_NAME ${EXECUTABLE_NAME}
RUNTIME_OUTPUT_DIRECTORY_RELEASE ${DEMOLITION_OUTPUT_DIR} RUNTIME_OUTPUT_DIRECTORY_RELEASE ${COMPILE_OUTPUT_DIECTRORY}
RUNTIME_OUTPUT_NAME_DEBUG ${DEMOLITION_EXE_NAME}d RUNTIME_OUTPUT_NAME_DEBUG ${EXECUTABLE_NAME}d
RUNTIME_OUTPUT_DIRECTORY_DEBUG ${DEMOLITION_OUTPUT_DIR} RUNTIME_OUTPUT_DIRECTORY_DEBUG ${COMPILE_OUTPUT_DIECTRORY}
RUNTIME_OUTPUT_NAME_MINSIZEREL ${DEMOLITION_EXE_NAME}msr RUNTIME_OUTPUT_NAME_MINSIZEREL ${EXECUTABLE_NAME}msr
RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${DEMOLITION_OUTPUT_DIR} RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${COMPILE_OUTPUT_DIECTRORY}
RUNTIME_OUTPUT_NAME_RELWITHDEBINFO ${DEMOLITION_EXE_NAME}rd RUNTIME_OUTPUT_NAME_RELWITHDEBINFO ${EXECUTABLE_NAME}rd
RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${DEMOLITION_OUTPUT_DIR} RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${COMPILE_OUTPUT_DIECTRORY}
) )
endif() endif()
if( MSVC ) if( MSVC )
option( DEMOLITION_GENERATE_MAPFILE "Generate .map file for debugging." OFF ) option( COMPILE_GENERATE_MAPFILE "Generate .map file for debugging." OFF )
set( LINKERSTUFF "/MANIFEST:NO" ) set( LINKERSTUFF "/MANIFEST:NO" )
if( DEMOLITION_GENERATE_MAPFILE ) if( COMPILE_GENERATE_MAPFILE )
set( LINKERSTUFF "${LINKERSTUFF} /MAP" ) set( LINKERSTUFF "${LINKERSTUFF} /MAP" )
endif() endif()
set_target_properties(demolition PROPERTIES LINK_FLAGS ${LINKERSTUFF}) set_target_properties(demolition PROPERTIES LINK_FLAGS ${LINKERSTUFF})
@ -938,7 +931,7 @@ if( MSVC )
endif() endif()
if( NOT WIN32 AND NOT APPLE ) if( NOT WIN32 AND NOT APPLE )
FILE( WRITE ${CMAKE_CURRENT_BINARY_DIR}/link-make "if [ ! -e ${DEMOLITION_OUTPUT_DIR}/${DEMOLITION_EXE_NAME} ]; then ln -sf ${CMAKE_CURRENT_BINARY_DIR}/${DEMOLITION_EXE_NAME} ${DEMOLITION_OUTPUT_DIR}/${DEMOLITION_EXE_NAME}; fi" ) 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 add_custom_command( TARGET demolition POST_BUILD
COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/link-make COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/link-make
COMMAND /bin/sh -c ${CMAKE_CURRENT_BINARY_DIR}/link-make ) COMMAND /bin/sh -c ${CMAKE_CURRENT_BINARY_DIR}/link-make )
@ -946,7 +939,7 @@ endif()
#add_custom_command(TARGET demolition POST_BUILD #add_custom_command(TARGET demolition POST_BUILD
# COMMAND ${CMAKE_COMMAND} -E copy_if_different # COMMAND ${CMAKE_COMMAND} -E copy_if_different
# ${CMAKE_SOURCE_DIR}/soundfont/gdemolition.sf2 $<TARGET_FILE_DIR:demolition>/soundfonts/gdemolition.sf2 # ${CMAKE_SOURCE_DIR}/soundfont/demolition.sf2 $<TARGET_FILE_DIR:demolition>/soundfonts/demolition.sf2
# COMMAND ${CMAKE_COMMAND} -E copy_if_different # 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:demolition>/fm_banks/GENMIDI.GS.wopl
# COMMAND ${CMAKE_COMMAND} -E copy_if_different # COMMAND ${CMAKE_COMMAND} -E copy_if_different
@ -957,14 +950,6 @@ if( CMAKE_COMPILER_IS_GNUCXX )
# GCC misoptimizes this file # GCC misoptimizes this file
#set_source_files_properties( oplsynth/fmopl.cpp PROPERTIES COMPILE_FLAGS "-fno-tree-dominator-opts -fno-tree-fre" ) #set_source_files_properties( oplsynth/fmopl.cpp PROPERTIES COMPILE_FLAGS "-fno-tree-dominator-opts -fno-tree-fre" )
endif() endif()
#if( DEM_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE )
# Need to enable intrinsics for these files.
# if( SSE_MATTERS )
# set_source_files_properties(
# utility/x86.cpp
# PROPERTIES COMPILE_FLAGS "-msse2 -mmmx" )
# endif()
#endif()
if( APPLE ) if( APPLE )
set( LINK_FRAMEWORKS "-framework Cocoa -framework IOKit -framework OpenGL") set( LINK_FRAMEWORKS "-framework Cocoa -framework IOKit -framework OpenGL")
@ -983,9 +968,9 @@ if( APPLE )
endif() endif()
if( WIN32 ) if( WIN32 )
set( INSTALL_PATH . CACHE STRING "Directory where the demolition executable will be placed during install." ) set( INSTALL_PATH . CACHE STRING "Directory where the executable will be placed during install." )
else() else()
set( INSTALL_PATH bin CACHE STRING "Directory where the demolition executable will be placed during install." ) set( INSTALL_PATH bin CACHE STRING "Directory where the executable will be placed during install." )
endif() endif()
install(TARGETS demolition install(TARGETS demolition
DESTINATION ${INSTALL_PATH} DESTINATION ${INSTALL_PATH}

View file

@ -24,7 +24,7 @@ BEGIN
//CONTROL "Load lights",IDC_WELCOME_LIGHTS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,130,180,51,10 //CONTROL "Load lights",IDC_WELCOME_LIGHTS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,130,180,51,10
//CONTROL "Load brightmaps",IDC_WELCOME_BRIGHTMAPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,130,190,65,10 //CONTROL "Load brightmaps",IDC_WELCOME_BRIGHTMAPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,130,190,65,10
CONTROL "Don't ask me this again",IDC_DONTASKIWAD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,73,211,87,10 CONTROL "Don't ask me this again",IDC_DONTASKIWAD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,73,211,87,10
DEFPUSHBUTTON "Play Demolition",IDOK,8,228,90,14 DEFPUSHBUTTON "Play!",IDOK,8,228,90,14
PUSHBUTTON "Exit",IDCANCEL,166,228,50,14 PUSHBUTTON "Exit",IDCANCEL,166,228,50,14
CONTROL "OpenGL",IDC_WELCOME_VULKAN1,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,13,167,41,10 CONTROL "OpenGL",IDC_WELCOME_VULKAN1,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,13,167,41,10
CONTROL "Vulkan",IDC_WELCOME_VULKAN2,"Button",BS_AUTORADIOBUTTON | WS_DISABLED,13,177,37,10 CONTROL "Vulkan",IDC_WELCOME_VULKAN2,"Button",BS_AUTORADIOBUTTON | WS_DISABLED,13,177,37,10