-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
50 lines (36 loc) · 1.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
cmake_minimum_required(VERSION 3.21)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_EXTENSIONS OFF)
project(mini_golf)
include(cmake/PreventInSourceBuild.cmake)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ProjectOptions.cmake)
include(ProjectOptions.cmake)
project_options_setup()
project_local_options()
target_compile_features(project_options INTERFACE cxx_std_${CMAKE_CXX_STANDARD})
add_library(project::project_options ALIAS project_options)
add_library(project::project_warnings ALIAS project_warnings)
include_directories(src)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${PROJECT_NAME}")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_compile_definitions(__DEBUG__)
elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
add_compile_definitions(__DIST__)
elseif(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
add_compile_definitions(__RELEASE__)
endif()
if(${USE_COMPILER} STREQUAL "cl")
add_compile_definitions(__COMPILER_CL__)
elseif(${USE_COMPILER} STREQUAL "clang-cl")
add_compile_definitions(__COMPILER_CLANG_CL__)
elseif(${USE_COMPILER} STREQUAL "gcc")
add_compile_definitions(__COMPILER_GCC__)
elseif(${USE_COMPILER} STREQUAL "clang")
add_compile_definitions(__COMPILER_CLANG__)
endif()
add_compile_definitions(GLM_FORCE_CXX11)
add_compile_definitions(GLM_FORCE_SILENT_WARNINGS)
if(APPLE)
add_compile_definitions(DCMAKE_OSX_ARCHITECTURES arm64)
endif()
add_subdirectory(src)