2020-03-28 01:21:14 +00:00
|
|
|
cmake_minimum_required(VERSION 3.17)
|
|
|
|
project(JP2_PC)
|
|
|
|
|
|
|
|
set(CMAKE_SUPPRESS_REGENERATION true) #Suppress zero-check project
|
|
|
|
set(CMake_MSVC_PARALLEL true GLOBAL)
|
|
|
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
|
|
|
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT trespass)
|
2020-09-05 10:17:31 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /GF")
|
2020-03-28 01:21:14 +00:00
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
|
|
|
|
2020-04-08 19:04:48 +00:00
|
|
|
#Linker flag required by the self-modifying assembly code in DrawSubTriangle in project ScreenRenderDWI
|
|
|
|
#Can be removed after assembly code has been replaced
|
|
|
|
#ERW = Execute, read, write
|
2020-09-05 10:17:31 +00:00
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SECTION:SelfMod,ERW")
|
|
|
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SECTION:SelfMod,ERW")
|
2020-04-08 19:04:48 +00:00
|
|
|
|
2020-03-28 20:43:29 +00:00
|
|
|
|
2020-09-05 10:17:31 +00:00
|
|
|
set(STATICALLY_LINK_RUNTIME_LIBRARIES TRUE CACHE BOOL INTERNAL)
|
|
|
|
if (STATICALLY_LINK_RUNTIME_LIBRARIES)
|
|
|
|
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
|
|
|
set(CMAKE_MFC_FLAG 1)
|
|
|
|
else()
|
|
|
|
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
|
|
|
|
set(CMAKE_MFC_FLAG 2)
|
|
|
|
endif()
|
|
|
|
|
2021-04-24 16:38:31 +00:00
|
|
|
set(ENABLE_SANITIZERS FALSE CACHE BOOL INTERNAL)
|
|
|
|
if (ENABLE_SANITIZERS)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fsanitize=address")
|
|
|
|
endif()
|
|
|
|
|
2020-03-28 20:43:29 +00:00
|
|
|
set(USE_TRESPASSER_DIRECTORY TRUE CACHE BOOL INTERNAL)
|
|
|
|
|
2020-03-28 01:21:14 +00:00
|
|
|
get_filename_component(TRESPASS_INSTALL_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\DreamWorks Interactive\\Trespasser;Installed Directory]" ABSOLUTE)
|
2020-03-28 20:43:29 +00:00
|
|
|
|
|
|
|
if ( (NOT TRESPASS_INSTALL_DIR STREQUAL "/registry") AND USE_TRESPASSER_DIRECTORY ) #Found and read the registry entry, and it is valid
|
2020-03-28 01:21:14 +00:00
|
|
|
set(FOUND_TRESPASS_DIR TRUE)
|
2021-04-24 23:38:15 +00:00
|
|
|
set(CMAKE_INSTALL_PREFIX ${TRESPASS_INSTALL_DIR} CACHE STRING INTERNAL)
|
2020-03-28 01:21:14 +00:00
|
|
|
else()
|
|
|
|
set(FOUND_TRESPASS_DIR FALSE)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(CMAKE_CONFIGURATION_TYPES Debug Release Final CACHE STRING INTERNAL FORCE)
|
|
|
|
|
|
|
|
include(cmake/CMakeCommon.cmake)
|
2021-07-04 20:40:06 +00:00
|
|
|
createGitVersionFile()
|
2020-03-28 01:21:14 +00:00
|
|
|
|
|
|
|
add_subdirectory(cmake/AI)
|
|
|
|
add_subdirectory(cmake/AITest)
|
2020-05-07 19:26:57 +00:00
|
|
|
add_subdirectory(cmake/AIUnitTest)
|
2020-03-28 01:21:14 +00:00
|
|
|
add_subdirectory(cmake/Audio)
|
2020-04-13 14:27:40 +00:00
|
|
|
add_subdirectory(cmake/AudioTest)
|
2020-03-28 01:21:14 +00:00
|
|
|
add_subdirectory(cmake/Bugs)
|
2020-04-05 18:02:12 +00:00
|
|
|
add_subdirectory(cmake/BumpBuild)
|
2020-04-13 14:27:40 +00:00
|
|
|
add_subdirectory(cmake/BumpTest)
|
2020-03-28 01:21:14 +00:00
|
|
|
add_subdirectory(cmake/CollisionEditor)
|
2020-04-13 14:27:40 +00:00
|
|
|
add_subdirectory(cmake/ColourTest)
|
2020-06-07 21:26:31 +00:00
|
|
|
add_subdirectory(cmake/DefaultConfigGenerator)
|
2020-03-28 01:21:14 +00:00
|
|
|
add_subdirectory(cmake/EntityDBase)
|
|
|
|
add_subdirectory(cmake/Examples)
|
2020-04-13 14:27:40 +00:00
|
|
|
add_subdirectory(cmake/FastBumpTest)
|
2020-03-28 01:21:14 +00:00
|
|
|
add_subdirectory(cmake/File)
|
|
|
|
add_subdirectory(cmake/FileTest)
|
|
|
|
add_subdirectory(cmake/Game)
|
|
|
|
add_subdirectory(cmake/GeomDBase)
|
|
|
|
add_subdirectory(cmake/GroffBuild)
|
|
|
|
add_subdirectory(cmake/GroffExp)
|
2020-04-16 18:19:16 +00:00
|
|
|
add_subdirectory(cmake/GTestLibGlobals)
|
2020-03-28 01:21:14 +00:00
|
|
|
add_subdirectory(cmake/GUIApp)
|
|
|
|
add_subdirectory(cmake/InitGUIApp)
|
|
|
|
add_subdirectory(cmake/InitGUIApp2)
|
|
|
|
add_subdirectory(cmake/LZSS)
|
|
|
|
add_subdirectory(cmake/Loader)
|
2020-04-16 18:19:16 +00:00
|
|
|
add_subdirectory(cmake/LoaderTest)
|
2020-03-28 01:21:14 +00:00
|
|
|
add_subdirectory(cmake/Math)
|
|
|
|
add_subdirectory(cmake/MathTest)
|
|
|
|
add_subdirectory(cmake/Physics)
|
|
|
|
add_subdirectory(cmake/PhysicsTest)
|
|
|
|
add_subdirectory(cmake/PipelineTest)
|
2020-04-13 14:27:40 +00:00
|
|
|
add_subdirectory(cmake/PolyTest)
|
2020-03-28 01:21:14 +00:00
|
|
|
add_subdirectory(cmake/ProcessorDetect)
|
|
|
|
add_subdirectory(cmake/QuantizerTool)
|
|
|
|
add_subdirectory(cmake/QuantizerToolCLI)
|
2020-04-23 20:05:24 +00:00
|
|
|
add_subdirectory(cmake/RegToIniConverter)
|
2020-03-28 01:21:14 +00:00
|
|
|
add_subdirectory(cmake/Render3D)
|
|
|
|
add_subdirectory(cmake/ScreenRenderDWI)
|
|
|
|
add_subdirectory(cmake/Std)
|
2020-04-13 21:51:02 +00:00
|
|
|
add_subdirectory(cmake/StdTest)
|
2020-03-28 01:21:14 +00:00
|
|
|
add_subdirectory(cmake/System)
|
2020-04-16 18:19:16 +00:00
|
|
|
add_subdirectory(cmake/SystemTest)
|
2020-03-28 01:21:14 +00:00
|
|
|
add_subdirectory(cmake/trespass)
|
|
|
|
add_subdirectory(cmake/TweakNvidia128)
|
|
|
|
add_subdirectory(cmake/TweakTrespass)
|
|
|
|
add_subdirectory(cmake/View)
|
2021-07-31 13:06:52 +00:00
|
|
|
add_subdirectory(cmake/ViewTest)
|
2020-03-28 01:21:14 +00:00
|
|
|
add_subdirectory(cmake/WaveTest)
|
|
|
|
add_subdirectory(cmake/WinShell)
|
2020-04-11 15:31:12 +00:00
|
|
|
|
2021-07-04 20:40:06 +00:00
|
|
|
add_subdirectory(cmake/DistDemo)
|
2020-04-11 15:31:12 +00:00
|
|
|
|
2020-04-13 19:25:39 +00:00
|
|
|
option(INSTALL_GTEST OFF)
|
|
|
|
add_subdirectory(gtest)
|
|
|
|
set_target_properties(gtest PROPERTIES FOLDER "Tests/gtest")
|
|
|
|
set_target_properties(gtest_main PROPERTIES FOLDER "Tests/gtest")
|
|
|
|
set_target_properties(gmock PROPERTIES FOLDER "Tests/gtest")
|
|
|
|
set_target_properties(gmock_main PROPERTIES FOLDER "Tests/gtest")
|
|
|
|
|
2021-07-04 20:40:06 +00:00
|
|
|
enable_testing()
|
2021-07-09 21:56:53 +00:00
|
|
|
list(APPEND CMAKE_CTEST_ARGUMENTS "--output-on-failure")
|
2020-04-11 15:31:12 +00:00
|
|
|
|
|
|
|
set(DEACTIVATE_BROKEN_PROJECTS TRUE CACHE BOOL INTERNAL)
|
|
|
|
|
|
|
|
if (DEACTIVATE_BROKEN_PROJECTS)
|
|
|
|
list(APPEND BROKEN_PROJECTS
|
2020-04-13 14:27:40 +00:00
|
|
|
AudioTest
|
2020-04-11 15:31:12 +00:00
|
|
|
Bugs
|
2020-04-13 14:27:40 +00:00
|
|
|
BumpTest
|
2020-04-11 15:31:12 +00:00
|
|
|
CollisionEditor
|
|
|
|
Examples
|
2020-04-13 14:27:40 +00:00
|
|
|
FastBumpTest
|
2020-04-11 15:31:12 +00:00
|
|
|
InitGUIApp
|
2020-04-13 14:27:40 +00:00
|
|
|
PolyTest
|
2020-04-11 15:31:12 +00:00
|
|
|
PipelineTest
|
|
|
|
QuantizerToolCLI
|
|
|
|
TweakTrespass
|
|
|
|
WaveTest
|
|
|
|
)
|
2020-04-11 16:17:41 +00:00
|
|
|
|
2020-04-11 15:31:12 +00:00
|
|
|
foreach(broken ${BROKEN_PROJECTS})
|
2020-04-11 16:17:41 +00:00
|
|
|
set_target_properties(${broken} PROPERTIES EXCLUDE_FROM_ALL true) #When building the ALL_BUILD project
|
|
|
|
set_target_properties(${broken} PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD true) #When building the entire solution
|
2020-04-11 15:31:12 +00:00
|
|
|
endforeach()
|
|
|
|
endif()
|