2019-10-29 18:53:46 +00:00
|
|
|
cmake_minimum_required( VERSION 3.1.0 )
|
2019-10-16 21:09:02 +00:00
|
|
|
|
|
|
|
if (MSVC)
|
|
|
|
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /J" )
|
|
|
|
endif()
|
|
|
|
|
|
|
|
include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/../../build/include" )
|
|
|
|
|
|
|
|
if (WIN32)
|
2019-11-02 21:10:53 +00:00
|
|
|
include_directories( "${ZLIB_INCLUDE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../../platform/windows/include" "${CMAKE_CURRENT_SOURCE_DIR}/../../platform/windows/include/vpx" "${CMAKE_CURRENT_SOURCE_DIR}/../../platform/windows/include/sdl2" )
|
2019-10-16 21:09:02 +00:00
|
|
|
else ()
|
2019-10-20 07:16:01 +00:00
|
|
|
include_directories( "${ZLIB_INCLUDE_DIR}" "${BZIP2_INCLUDE_DIR}" "${LZMA_INCLUDE_DIR}" "${JPEG_INCLUDE_DIR}" "${GDTOA_INCLUDE_DIR}")
|
2019-10-16 21:09:02 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
include_directories(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../build/include
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../mact/include
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../audiolib/include
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../libsmackerdec/include
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../thirdparty/include
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../common
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../common/utility
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../common/console
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../common/textures
|
2019-11-05 19:07:16 +00:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../common/fonts
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../common/2d
|
2019-10-16 21:09:02 +00:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../platform
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2019-10-31 22:25:21 +00:00
|
|
|
|
2019-10-16 21:09:02 +00:00
|
|
|
set( NOT_COMPILED_SOURCE_FILES
|
|
|
|
src/gamestructures.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
set_source_files_properties( ${NOT_COMPILED_SOURCE_FILES} PROPERTIES HEADER_FILE_ONLY TRUE )
|
|
|
|
|
|
|
|
set( PCH_SOURCES
|
|
|
|
src/actors.cpp
|
|
|
|
src/anim.cpp
|
|
|
|
src/cheats.cpp
|
|
|
|
src/cmdline.cpp
|
|
|
|
src/common.cpp
|
|
|
|
src/config.cpp
|
|
|
|
src/demo.cpp
|
|
|
|
src/game.cpp
|
|
|
|
src/gamedef.cpp
|
|
|
|
src/gameexec.cpp
|
|
|
|
src/gamevars.cpp
|
|
|
|
src/global.cpp
|
|
|
|
src/menus.cpp
|
|
|
|
src/namesdyn.cpp
|
|
|
|
src/network.cpp
|
|
|
|
src/osdcmds.cpp
|
|
|
|
src/player.cpp
|
|
|
|
src/premap.cpp
|
|
|
|
src/savegame.cpp
|
|
|
|
src/sbar.cpp
|
|
|
|
src/screens.cpp
|
|
|
|
src/screentext.cpp
|
|
|
|
src/sector.cpp
|
|
|
|
src/sounds.cpp
|
|
|
|
src/soundsdyn.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
if( MSVC )
|
|
|
|
enable_precompiled_headers( ../g_pch.h PCH_SOURCES )
|
|
|
|
# The original Build code was written with unsigned chars and unfortunately they still haven't been eliminated entirely.
|
|
|
|
# All other code should stay with signed chars. What a mess... :(
|
|
|
|
#set_source_files_properties( ${PCH_SOURCES} PROPERTIES COMPILE_FLAGS "/J" )
|
|
|
|
else()
|
|
|
|
# Temporary solution for compilers other than MSVC
|
|
|
|
set_source_files_properties( ${PCH_SOURCES} PROPERTIES COMPILE_FLAGS "-include g_pch.h" )
|
|
|
|
endif()
|
|
|
|
|
|
|
|
file( GLOB HEADER_FILES
|
|
|
|
src/*.h
|
|
|
|
)
|
|
|
|
add_library( duke3d STATIC
|
|
|
|
${HEADER_FILES}
|
|
|
|
${PCH_SOURCES}
|
|
|
|
${NOT_COMPILED_SOURCE_FILES}
|
|
|
|
)
|
|
|
|
|
|
|
|
|