Add option for GameDLL version and source directory

Options could be set from the CMake GUI. By default, GameDLL version is set to 'GAMEDLL_S3', and engine source directory is set to 'r5dev/'.
This commit is contained in:
Kawe Mazidjatari 2023-05-14 16:27:31 +02:00
parent 78c80faf7d
commit c50f8d86f6
4 changed files with 21 additions and 8 deletions

View File

@ -6,13 +6,13 @@ include( "r5dev/cmake/Macros.cmake" )
include( "r5dev/cmake/Options.cmake" )
initial_setup()
define_compiler_variables()
setup_build_configurations()
define_compiler_variables()
apply_project_settings()
include_directories( ${ENGINE_SOURCE_DIR} )
include_directories( ${ENGINE_SOURCE_DIR}/public )
include_directories( ${ENGINE_SOURCE_DIR}/thirdparty )
include_directories( "${ENGINE_SOURCE_DIR}" )
include_directories( "${ENGINE_SOURCE_DIR}/public" )
include_directories( "${ENGINE_SOURCE_DIR}/thirdparty" )
# Include the subdirectories that contain the individual projects
add_subdirectory( ${ENGINE_SOURCE_DIR} )
add_subdirectory( "${ENGINE_SOURCE_DIR}" )

View File

@ -5,8 +5,11 @@ macro( initial_setup )
set( CMAKE_CXX_STANDARD 17 )
set( CMAKE_CXX_STANDARD_REQUIRED True )
set( ENGINE_SOURCE_DIR ${CMAKE_SOURCE_DIR}/r5dev )
set( GLOBAL_PCH ${ENGINE_SOURCE_DIR}/core/stdafx.h ) # Global precompiled header shared among all libraries
set(ENGINE_SOURCE_DIR "${CMAKE_SOURCE_DIR}/r5dev" CACHE PATH "Engine source directory")
set( GLOBAL_PCH
"${ENGINE_SOURCE_DIR}/core/stdafx.h"
) # Global precompiled header shared among all libraries
set_property( GLOBAL PROPERTY USE_FOLDERS ON ) # Use filters
endmacro()

View File

@ -12,12 +12,21 @@ macro( apply_project_settings )
$<$<CXX_COMPILER_ID:MSVC>:/DUNICODE>
)
set( GAMEDLL_OPTION "GAMEDLL_S3" CACHE STRING "Game DLL version" )
set_property( CACHE GAMEDLL_OPTION PROPERTY STRINGS
"GAMEDLL_S0"
"GAMEDLL_S1"
"GAMEDLL_S2"
"GAMEDLL_S3"
)
# Set common defines
add_compile_definitions(
"_CRT_SECURE_NO_WARNINGS"
"SPDLOG_COMPILED_LIB"
"SPDLOG_NO_EXCEPTIONS"
"CURL_STATICLIB"
"${GAMEDLL_OPTION}"
)
# Set settings for Debug configuration

View File

@ -4,10 +4,11 @@
* _basetypes
*-----------------------------------------------------------------------------*/
// These are set from CMake now.
//#define GAMEDLL_S0 /*[r]*/
//#define GAMEDLL_S1 /*[r]*/
//#define GAMEDLL_S2 /*[i]*/
#define GAMEDLL_S3 /*[r]*/
//#define GAMEDLL_S3 /*[r]*/
//#define GAMEDLL_S4 /*[i]*/
//#define GAMEDLL_S5 /*[i]*/
//#define GAMEDLL_S7 /*[i]*/