mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-30 07:41:22 +00:00
de5d4715c2
CMake 2.4, since the distros don't seem to consider 2.6 stable yet. As a bonus, GTK+ is no longer a required dependency; now it's optional. - Made dehsupp ignore CR characters, so it doesn't spew warnings on Linux. SVN r1092 (trunk)
81 lines
3.3 KiB
CMake
81 lines
3.3 KiB
CMake
cmake_minimum_required( VERSION 2.4 )
|
|
|
|
set( ZDOOM_OUTPUT_DIR ${CMAKE_BINARY_DIR} CACHE PATH "Directory where zdoom.pk3 and the executable will be created" )
|
|
set( ZDOOM_EXE_NAME "zdoom" CACHE FILEPATH "Name of the executable to create" )
|
|
|
|
find_package( JPEG )
|
|
find_package( ZLIB )
|
|
|
|
if( MSVC )
|
|
# Eliminate unreferenced functions and data
|
|
# Perform identical COMDAT folding
|
|
set( REL_LINKER_FLAGS "/opt:ref /opt:icf /nodefaultlib:msvcrt" )
|
|
|
|
# String pooling
|
|
# Function-level linking
|
|
# Disable run-time type information
|
|
set( ALL_C_FLAGS "/GF /Gy /GR-" )
|
|
|
|
# Avoid CRT DLL dependancies in release builds
|
|
set( REL_C_FLAGS "/MT" )
|
|
|
|
# Debug allocations in debug builds
|
|
set( DEB_C_FLAGS "/D _CRTDBG_MAP_ALLOC" )
|
|
|
|
# Disable warnings for unsecure CRT functions from VC8+
|
|
if( MSVC_VERSION GREATER 1399 )
|
|
set( ALL_C_FLAGS "${ALL_C_FLAGS} /wd4996" )
|
|
endif( MSVC_VERSION GREATER 1399 )
|
|
|
|
# The CMake configurations set /GR and /MD by default, which conflict with our settings.
|
|
string(REPLACE "/MD " " " CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE} )
|
|
string(REPLACE "/MD " " " CMAKE_CXX_FLAGS_MINSIZEREL ${CMAKE_CXX_FLAGS_MINSIZEREL} )
|
|
string(REPLACE "/MD " " " CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO} )
|
|
string(REPLACE "/MD " " " CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE} )
|
|
string(REPLACE "/MD " " " CMAKE_C_FLAGS_MINSIZEREL ${CMAKE_C_FLAGS_MINSIZEREL} )
|
|
string(REPLACE "/MD " " " CMAKE_C_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO} )
|
|
string(REPLACE " /GR" " " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} )
|
|
endif( MSVC )
|
|
|
|
set( CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${REL_LINKER_FLAGS}" )
|
|
set( CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL} ${REL_LINKER_FLAGS}" )
|
|
set( CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} ${REL_LINKER_FLAGS}" )
|
|
|
|
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ALL_C_FLAGS}" )
|
|
set( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${REL_C_FLAGS}" )
|
|
set( CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} ${REL_C_FLAGS}" )
|
|
set( CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${REL_C_FLAGS}" )
|
|
set( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${DEB_C_FLAGS} -D_DEBUG" )
|
|
|
|
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ALL_C_FLAGS}" )
|
|
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${REL_C_FLAGS}" )
|
|
set( CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} ${REL_C_FLAGS}" )
|
|
set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${REL_C_FLAGS}" )
|
|
set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${DEB_C_FLAGS} -D_DEBUG" )
|
|
|
|
if( ZLIB_FOUND )
|
|
message( STATUS "Using system zlib" )
|
|
else( ZLIB_FOUND )
|
|
message( STATUS "Using internal zlib" )
|
|
add_subdirectory( zlib )
|
|
set( ZLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/zlib )
|
|
set( ZLIB_LIBRARIES z )
|
|
set( ZLIB_LIBRARY z )
|
|
endif( ZLIB_FOUND )
|
|
|
|
if( JPEG_FOUND )
|
|
message( STATUS "Using system jpeg library" )
|
|
else( JPEG_FOUND )
|
|
message( STATUS "Using internal jpeg library" )
|
|
add_subdirectory( jpeg-6b )
|
|
set( JPEG_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/jpeg-6b )
|
|
set( JPEG_LIBRARIES jpeg )
|
|
set( JPEG_LIBRARY jpeg )
|
|
endif( JPEG_FOUND )
|
|
|
|
add_subdirectory( tools )
|
|
add_subdirectory( snes_spc )
|
|
add_subdirectory( dumb )
|
|
add_subdirectory( gdtoa )
|
|
add_subdirectory( wadsrc )
|
|
add_subdirectory( src )
|