-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
51 lines (40 loc) · 1.36 KB
/
Copy pathCMakeLists.txt
File metadata and controls
51 lines (40 loc) · 1.36 KB
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
project(physics-based-simulation CXX)
cmake_minimum_required(VERSION 2.8.6)
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14)
if (COMPILER_SUPPORTS_CXX14)
add_compile_options(-std=c++14)
else()
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++14 support. Please use a different C++ compiler.")
endif()
if (MSVC)
add_definitions(-DNOMINMAX -DWIN32_LEAN_AND_MEAN)
if (CMAKE_BUILD_TYPE MATCHES "Deb")
add_compile_options(-Wall)
endif()
if (CMAKE_BUILD_TYPE MATCHES "Rel")
add_compile_options(-Ox -Qpar)
endif()
if (CMAKE_BUILD_TYPE MATCHES "Info")
add_compile_options(-Qpar-report=2)
endif()
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wfatal-errors")
if (CMAKE_BUILD_TYPE MATCHES "Deb")
add_compile_options(-Wall -g -ggdb)
endif()
if (CMAKE_BUILD_TYPE MATCHES "Rel")
add_compile_options(-O3 -march=native -ffast-math)
endif()
if (CMAKE_BUILD_TYPE MATCHES "Info")
add_compile_options(-fopt-info-vec-optimized -fopt-info-inline-optimized -ftree-vectorizer-verbose=2)
endif()
endif()
# Enable the creation of folders for Visual Studio projects
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
add_subdirectory(third_party)
add_subdirectory(src/flint)
add_subdirectory(src/flint_viewport)
add_subdirectory(src/simulation)
add_subdirectory(examples)
add_subdirectory(tests)