-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
executable file
·119 lines (96 loc) · 3.91 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
cmake_minimum_required(VERSION 3.5)
if (NOT DEFINED CMAKE_TOOLCHAIN_FILE)
if(DEFINED ENV{VCPKG_ROOT})
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "")
else()
set(CMAKE_TOOLCHAIN_FILE "vcpkg/scripts/buildsystems/vcpkg.cmake" CACHE STRING "")
endif()
endif()
include("${CMAKE_TOOLCHAIN_FILE}")
if (WIN32)
project(Grindstone VERSION 1.0.0 LANGUAGES CXX CSharp)
enable_language(CSharp)
else()
project(Grindstone VERSION 1.0.0 LANGUAGES CXX)
endif()
set(CMAKE_CXX_STANDARD 17)
find_package(fmt CONFIG REQUIRED)
find_package(glm CONFIG REQUIRED)
find_package(RapidJSON CONFIG REQUIRED)
find_package(EnTT CONFIG REQUIRED)
set(DEPS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/deps")
set(CODE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/sources/code")
set(COMMON_DIR "${CODE_DIR}/Common")
set(ENGINECORE_DIR "${CODE_DIR}/EngineCore")
set(EDITORCONFIG "${CODE_DIR}/.editorconfig")
set(BUILD_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
set(CORE_UTILS ${ENGINECORE_DIR}/Logger.cpp ${ENGINECORE_DIR}/Logger.hpp ${ENGINECORE_DIR}/Utils/MemoryAllocator.cpp ${ENGINECORE_DIR}/Utils/MemoryAllocator.hpp ${COMMON_DIR}/Memory/Allocators/DynamicAllocator.cpp ${COMMON_DIR}/Memory/Allocators/DynamicAllocator.hpp)
set(CORE_LIBS fmt::fmt)
set(ENGINE_CORE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/sources/code/EngineCore)
file(GLOB_RECURSE SOURCE_REFLECTION "${ENGINE_CORE_DIR}/Reflection/*.cpp")
file(GLOB_RECURSE HEADER_REFLECTION "${ENGINE_CORE_DIR}/Reflection/*.hpp")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${BUILD_DIRECTORY})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${BUILD_DIRECTORY})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${BUILD_DIRECTORY})
foreach( OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES} )
string( TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG )
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${BUILD_DIRECTORY} )
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${BUILD_DIRECTORY} )
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${BUILD_DIRECTORY} )
endforeach( OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES )
add_subdirectory(sources/code/Editor)
add_subdirectory(sources/code/EngineCore)
add_subdirectory(sources/code/ApplicationExecutable)
set(PLUGIN_DIR sources/code/Plugins)
option(USE_OPENGL "Include OpenGL?" OFF)
if (USE_OPENGL)
add_subdirectory(${PLUGIN_DIR}/GraphicsOpenGL)
endif()
option(USE_VULKAN "Include Vulkan?" ON)
if (USE_VULKAN)
add_subdirectory(${PLUGIN_DIR}/GraphicsVulkan)
endif()
option(USE_BULLET_PHYSICS "Include Bullet Physics?" ON)
if (USE_BULLET_PHYSICS)
add_subdirectory(${PLUGIN_DIR}/PhysicsBullet)
endif()
option(USE_AUDIO_OPENAL "Include OpenAL Audio?" ON)
if (USE_AUDIO_OPENAL)
add_subdirectory(${PLUGIN_DIR}/AudioOpenAL)
endif()
option(USE_ANIMATION "Include Animation?" OFF)
if (USE_ANIMATION)
add_subdirectory(${PLUGIN_DIR}/Animation)
endif()
option(USE_RENDERABLES_3D "Include Renderables 3D?" ON)
if (USE_RENDERABLES_3D)
add_subdirectory(${PLUGIN_DIR}/Renderables3D)
endif()
option(USE_EDITOR_AUDIO_IMPORTER "Include EditorAudioImporter?" ON)
if (USE_EDITOR_AUDIO_IMPORTER)
add_subdirectory(${PLUGIN_DIR}/EditorAudioImporter)
endif()
option(USE_EDITOR_MATERIAL_IMPORTER "Include EditorMaterialImporter?" ON)
if (USE_EDITOR_MATERIAL_IMPORTER)
add_subdirectory(${PLUGIN_DIR}/EditorMaterialImporter)
endif()
option(USE_EDITOR_MODEL_IMPORTER "Include EditorModelImporter?" ON)
if (USE_EDITOR_MODEL_IMPORTER)
add_subdirectory(${PLUGIN_DIR}/EditorModelImporter)
endif()
option(USE_EDITOR_SHADER_IMPORTER "Include EditorShaderImporter?" ON)
if (USE_EDITOR_SHADER_IMPORTER)
add_subdirectory(${PLUGIN_DIR}/EditorShaderImporter)
endif()
option(USE_EDITOR_TEXTURE_IMPORTER "Include EditorTextureImporter?" ON)
if (USE_EDITOR_TEXTURE_IMPORTER)
add_subdirectory(${PLUGIN_DIR}/EditorTextureImporter)
endif()
option(USE_CSHARP "Include CSharp?" ON)
if (USE_CSHARP)
add_subdirectory(${PLUGIN_DIR}/ScriptCSharp)
include_external_msproject(
GrindstoneCSharpCore GrindstoneCore.csproj
TYPE FAE04EC0-301F-11D3-BF4B-00C04F79EFBC
)
endif()