-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathCMakeLists.txt
64 lines (53 loc) · 2.39 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
cmake_minimum_required(VERSION 3.20)
#set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_LIST_DIR})
project(StratusGFX)
set(CMAKE_CXX_STANDARD 17)
# if (WIN32)
# message($ENV{SYSROOT})
# list(APPEND CMAKE_PREFIX_PATH
# $ENV{SYSROOT}/cmake
# $ENV{SYSROOT}/lib/cmake
# $ENV{SYSROOT}/lib/cmake/assimp-5.0
# $ENV{SYSROOT}/lib/cmake/Catch2
# $ENV{SYSROOT}/lib/cmake/meshoptimizer
# )
# endif ()
list(APPEND CMAKE_PREFIX_PATH
${CMAKE_CURRENT_LIST_DIR}/ThirdParty/cmake
${CMAKE_CURRENT_LIST_DIR}/ThirdParty/lib/cmake
${CMAKE_CURRENT_LIST_DIR}/ThirdParty/lib/cmake/Catch2
${CMAKE_CURRENT_LIST_DIR}/ThirdParty/lib/cmake/assimp
${CMAKE_CURRENT_LIST_DIR}/ThirdParty/lib/cmake/assimp-5.2
${CMAKE_CURRENT_LIST_DIR}/ThirdParty/lib/cmake/meshoptimizer
${CMAKE_CURRENT_LIST_DIR}/ThirdParty/lib64/cmake
${CMAKE_CURRENT_LIST_DIR}/ThirdParty/lib64/cmake/Catch2
${CMAKE_CURRENT_LIST_DIR}/ThirdParty/lib64/cmake/assimp
${CMAKE_CURRENT_LIST_DIR}/ThirdParty/lib64/cmake/assimp-5.2
${CMAKE_CURRENT_LIST_DIR}/ThirdParty/lib64/cmake/meshoptimizer)
option(DEPENDENCY_BUILD "Third party dependencies only" OFF)
option(BUILD_TESTS "Build engine integration and unit tests" ON)
file(GLOB BIN_DLLS ${CMAKE_CURRENT_SOURCE_DIR}/ThirdParty/bin/*)
file(
COPY ${BIN_DLLS}
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/Bin
)
# See https://stackoverflow.com/questions/7747857/in-cmake-how-do-i-work-around-the-debug-and-release-directories-visual-studio-2
# First for the generic no-config case (e.g. with mingw)
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/Bin )
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/Bin )
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/Bin )
# Second, for multi-config builds (e.g. msvc)
foreach( OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES} )
string( TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG )
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_CURRENT_LIST_DIR}/Bin )
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_CURRENT_LIST_DIR}/Bin )
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_CURRENT_LIST_DIR}/Bin )
endforeach( OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES )
include_directories(${CMAKE_CURRENT_LIST_DIR}/stb)
add_subdirectory(Source/)
add_subdirectory(Examples/)
#include(CTest)
#enable_testing()
if (BUILD_TESTS)
add_subdirectory(Tests)
endif()