-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
60 lines (49 loc) · 1.64 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 entry point
cmake_minimum_required(VERSION 3.16)
message(">> Unreal CMakeLists.txt")
# THIS HAS TO COME BEFORE THE PROJECT LINE
#if (APPLE)
# execute_process(COMMAND sw_vers OUTPUT_VARIABLE OSX_VERSION)
# string(REGEX MATCH "([0-9]+.[0-9]+)" OSX_VERSION ${OSX_VERSION})
# message("OSX_VERSION: ${OSX_VERSION}")
# string(REGEX MATCH "[0-9]+$" OSX_FAMILY ${OSX_VERSION})
#
# if (OSX_FAMILY LESS 15)
# # Only macOS 15 has std::filesystem libraries in CLang, so use brew installed GCC instead
# message(STATUS "Using GCC compiler on macOS")
# #set(CMAKE_C_COMPILER "/usr/local/bin/gcc-9")
# #set(CMAKE_CXX_COMPILER "/usr/local/bin/g++-9")
# endif (OSX_FAMILY LESS 15)
#endif (APPLE)
# THIS HAS TO COME BEFORE THE PROJECT LINE
project (unreal)
# Build options
option(TESTS "Build the tests" ON)
option(BENCHMARK "Execute benchmarks" ON)
# Default to Release mode
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif (NOT CMAKE_BUILD_TYPE)
message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
# Disable modern SDK warnings about insecurity for POSIX functions
if (MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif (MSVC)
# Set the output directories
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
# Emulator test console client
add_subdirectory(testclient)
# Unit tests
#add_subdirectory(core/tests)
if (TESTS)
message("Building tests")
enable_testing()
add_subdirectory(core/tests)
endif (TESTS)
# Benchmarks
if (BENCHMARK)
message("Building benchmarks")
add_subdirectory(core/benchmarks)
endif (BENCHMARK)