forked from Gh0stBlade/KAIN2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
60 lines (49 loc) · 1.46 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
cmake_minimum_required (VERSION 3.5)
project ("Soul Reaver")
macro(OPTIONAL_DEFINE DEFNAME DESCRIPTION VALUE)
set(${DEFNAME} ${VALUE})
list(APPEND OPT_DEFINITIONS ${DEFNAME})
endmacro()
macro(BuildPreProcessorDefinitions)
foreach(DEF ${OPT_DEFINITIONS})
if(${${DEF}} STREQUAL "ON")
target_compile_definitions(${PROJECT_NAME} PRIVATE ${DEF}=1)
else()
target_compile_definitions(${PROJECT_NAME} PRIVATE ${DEF}=0)
endif()
list(REMOVE_ITEM OPT_DEFINITIONS ${DEF})
endforeach()
endmacro()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/CMake")
#Set root path
set(ROOT_DIR ${ROOT_DIR} "${CMAKE_CURRENT_SOURCE_DIR}")
#Stores root external lib folder.
set(EXTERN_LIB_PATH ${EXTERN_LIB_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/External")
#Extract target architecture (MSVC only)
if (MSVC OR APPLE OR DEFINED PLATFORM_PSP2)
if(${PLATFORM_DURANGO})
set(TARGET_ARCH "Durango64")
elseif(${PLATFORM_PSP2})
set(TARGET_ARCH "PSP2")
elseif(${PLATFORM_NX})
set(TARGET_ARCH "NX")
elseif(APPLE)
set(TARGET_ARCH "Mac")
elseif(LINUX)
set(TARGET_ARCH "Linux")
elseif(CMAKE_CL_64)
set(TARGET_ARCH "Win64")
else()
set(TARGET_ARCH "Win32")
endif()
endif()
if (ANDROID)
set(TARGET_ARCH "Androidx86")
endif()
if (EMSCRIPTEN)
set(TARGET_ARCH "Web")
endif()
#We want to be able to group projects in folders
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
add_subdirectory(External)
add_subdirectory(KAIN2)