2020-01-26 00:13:29 +00:00
|
|
|
cmake_minimum_required(VERSION 3.15)
|
2020-01-25 23:30:11 +00:00
|
|
|
project(PsyDoom)
|
2020-01-25 23:05:52 +00:00
|
|
|
|
|
|
|
# Current game version string
|
2021-10-17 06:06:05 +00:00
|
|
|
set(GAME_VERSION_STR "0.8.3")
|
2019-10-03 06:22:38 +00:00
|
|
|
|
|
|
|
# Where CMake will search for .cmake module files
|
|
|
|
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
|
|
|
|
2021-03-04 09:48:47 +00:00
|
|
|
# MacOS: target ARM and Intel 64-bit
|
|
|
|
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
|
|
|
|
|
2019-10-03 06:22:38 +00:00
|
|
|
# Causes CMake projects to go into their own folders
|
|
|
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
|
|
|
|
|
|
|
# Include common build scripts and do basic build setup
|
|
|
|
include(HelperFunctions)
|
|
|
|
include(BuildSetup)
|
|
|
|
|
|
|
|
build_setup()
|
|
|
|
|
|
|
|
# Global identifiers for each project/target
|
2020-09-01 08:37:32 +00:00
|
|
|
set(ASIO_TGT_NAME Asio)
|
|
|
|
set(AUDIO_TOOLS_COMMON_TGT_NAME AudioToolsCommon)
|
2020-09-07 07:52:26 +00:00
|
|
|
set(BASELIB_TGT_NAME BaseLib)
|
2020-09-01 08:37:32 +00:00
|
|
|
set(DOOM_DISASM_TGT_NAME DoomDisassemble)
|
|
|
|
set(GAME_TGT_NAME PsyDoom)
|
2021-05-05 06:50:39 +00:00
|
|
|
set(HASH_LIBRARY_TGT_NAME Hash-Library)
|
2020-09-17 07:11:15 +00:00
|
|
|
set(LCD_TOOL_TGT_NAME LcdTool)
|
2020-09-01 08:37:32 +00:00
|
|
|
set(LIBSDL_TGT_NAME SDL)
|
2021-06-15 06:49:21 +00:00
|
|
|
set(LUA_TGT_NAME Lua)
|
2020-09-01 08:37:32 +00:00
|
|
|
set(PSXEXE_SIGMATCH_TGT_NAME PSXExeSigMatcher)
|
|
|
|
set(PSXOBJ_SIGGEN_TGT_NAME PSXObjSigGen)
|
|
|
|
set(RAPID_JSON_TGT_NAME RapidJson)
|
|
|
|
set(REVERSING_COMMON_TGT_NAME ReversingCommon)
|
2020-12-17 19:23:13 +00:00
|
|
|
set(SIMPLE_GPU_TGT_NAME SimpleGpu)
|
2020-09-01 08:37:32 +00:00
|
|
|
set(SIMPLE_SPU_TGT_NAME SimpleSpu)
|
2021-06-15 07:10:49 +00:00
|
|
|
set(SOL2_TGT_NAME Sol2)
|
2020-09-26 06:39:38 +00:00
|
|
|
set(VAG_TOOL_TGT_NAME VagTool)
|
2022-01-21 08:32:27 +00:00
|
|
|
set(VRAM_DUMP_GETRECT_TGT_NAME VRAMDumpGetRect)
|
2021-01-04 08:03:42 +00:00
|
|
|
set(VULKAN_GL_TGT_NAME VulkanGL)
|
2020-09-26 07:29:57 +00:00
|
|
|
set(WMD_TOOL_TGT_NAME WmdTool)
|
2020-08-27 06:47:46 +00:00
|
|
|
|
2021-01-04 08:03:42 +00:00
|
|
|
# Compile in support for the Vulkan renderer?
|
|
|
|
set(PSYDOOM_INCLUDE_VULKAN_RENDERER TRUE CACHE BOOL
|
|
|
|
"If TRUE (default) then compile in support for the new Vulkan renderer.
|
|
|
|
Disabling this setting may make it easier to port to platforms which don't support Vulkan.")
|
|
|
|
|
2021-03-07 06:21:33 +00:00
|
|
|
# Enable certain limit removing features?
|
|
|
|
set(PSYDOOM_LIMIT_REMOVING TRUE CACHE BOOL
|
|
|
|
"If TRUE (default) then various limit removing or increasing features will be compiled into the engine.
|
|
|
|
This also includes extensions to the classic renderer to support high walls, and fix bugs where you can
|
|
|
|
see the geometry of adjacent rooms through sky ceilings.")
|
|
|
|
|
2020-08-27 06:47:46 +00:00
|
|
|
# Settings to include or exclude optional portions of the project tree
|
2021-01-04 08:03:42 +00:00
|
|
|
set(PSYDOOM_INCLUDE_GAME TRUE CACHE BOOL
|
|
|
|
"If TRUE include the game itself in the project tree.
|
2021-03-07 06:21:33 +00:00
|
|
|
Optionally, you could remove the game if you just wanted to compile the audio tools for example.")
|
2021-01-04 08:03:42 +00:00
|
|
|
|
2020-08-27 06:47:46 +00:00
|
|
|
set(PSYDOOM_INCLUDE_REVERSING_TOOLS FALSE CACHE BOOL
|
|
|
|
"If TRUE include reverse engineering tools in the project tree.
|
2021-03-07 06:21:33 +00:00
|
|
|
These were tools which were used during the earlier stages of development.")
|
2020-08-27 06:47:46 +00:00
|
|
|
|
2020-09-01 08:37:32 +00:00
|
|
|
set(PSYDOOM_INCLUDE_AUDIO_TOOLS FALSE CACHE BOOL
|
2021-03-07 06:21:33 +00:00
|
|
|
"If TRUE include PlayStation Doom audio related tools in the project tree.")
|
2020-09-01 08:37:32 +00:00
|
|
|
|
2019-10-03 06:22:38 +00:00
|
|
|
# Adding individual projects and libraries
|
2020-09-07 07:52:26 +00:00
|
|
|
add_subdirectory("${PROJECT_SOURCE_DIR}/baselib")
|
2020-04-18 21:02:08 +00:00
|
|
|
add_subdirectory("${PROJECT_SOURCE_DIR}/third_party_libs/rapidjson")
|
2020-08-27 06:47:46 +00:00
|
|
|
|
2021-01-04 08:03:42 +00:00
|
|
|
if (PSYDOOM_INCLUDE_GAME)
|
|
|
|
add_subdirectory("${PROJECT_SOURCE_DIR}/game")
|
|
|
|
add_subdirectory("${PROJECT_SOURCE_DIR}/simple_gpu")
|
|
|
|
add_subdirectory("${PROJECT_SOURCE_DIR}/simple_spu")
|
|
|
|
add_subdirectory("${PROJECT_SOURCE_DIR}/third_party_libs/asio")
|
2021-05-05 06:50:39 +00:00
|
|
|
add_subdirectory("${PROJECT_SOURCE_DIR}/third_party_libs/hash-library")
|
2021-01-04 08:03:42 +00:00
|
|
|
add_subdirectory("${PROJECT_SOURCE_DIR}/third_party_libs/libsdl")
|
2021-06-15 06:49:21 +00:00
|
|
|
add_subdirectory("${PROJECT_SOURCE_DIR}/third_party_libs/lua")
|
2021-06-15 07:10:49 +00:00
|
|
|
add_subdirectory("${PROJECT_SOURCE_DIR}/third_party_libs/sol2")
|
2021-01-04 08:03:42 +00:00
|
|
|
|
|
|
|
if (PSYDOOM_INCLUDE_VULKAN_RENDERER)
|
|
|
|
add_subdirectory("${PROJECT_SOURCE_DIR}/vulkan_gl")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2020-09-01 08:37:32 +00:00
|
|
|
if (PSYDOOM_INCLUDE_AUDIO_TOOLS)
|
|
|
|
add_subdirectory("${PROJECT_SOURCE_DIR}/tools/audio/audio_tools_common")
|
2020-09-17 07:11:15 +00:00
|
|
|
add_subdirectory("${PROJECT_SOURCE_DIR}/tools/audio/lcd_tool")
|
2020-09-26 06:39:38 +00:00
|
|
|
add_subdirectory("${PROJECT_SOURCE_DIR}/tools/audio/vag_tool")
|
2020-09-26 07:29:57 +00:00
|
|
|
add_subdirectory("${PROJECT_SOURCE_DIR}/tools/audio/wmd_tool")
|
2020-09-01 08:37:32 +00:00
|
|
|
endif()
|
|
|
|
|
2020-08-27 06:47:46 +00:00
|
|
|
if (PSYDOOM_INCLUDE_REVERSING_TOOLS)
|
|
|
|
add_subdirectory("${PROJECT_SOURCE_DIR}/tools/reversing/doom_disassemble")
|
|
|
|
add_subdirectory("${PROJECT_SOURCE_DIR}/tools/reversing/psxexe_sigmatcher")
|
|
|
|
add_subdirectory("${PROJECT_SOURCE_DIR}/tools/reversing/psxobj_siggen")
|
|
|
|
add_subdirectory("${PROJECT_SOURCE_DIR}/tools/reversing/reversing_common")
|
2022-01-21 08:32:27 +00:00
|
|
|
add_subdirectory("${PROJECT_SOURCE_DIR}/tools/reversing/vram_dump_getrect")
|
2020-08-27 06:47:46 +00:00
|
|
|
endif()
|