-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
57 lines (40 loc) · 1.78 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
cmake_minimum_required(VERSION 3.1)
enable_language(CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
project(chrono-sdf-loader)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_compile_options(-std=c++14 -pedantic-errors -Wall -Werror -Weverything -Wno-float-equal -Wno-padded -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-error=unused-parameter -Wno-error=global-constructors -Wno-error=exit-time-destructors)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_compile_options(-std=c++14 -pedantic-errors -Wall -Wextra -Werror -Wno-float-equal -Wno-padded -Wno-unused-parameter -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=5 -Wswitch-default -Wundef -Wno-error=unused)
endif()
if(NOT CONFIG)
set(CONFIG RELEASE)
endif()
if(CONFIG STREQUAL "DEBUG")
add_compile_options(-O0 -g3)
elseif(CONFIG STREQUAL "RELEASE")
add_compile_options(-O3 -march=native)
endif()
find_package(Chrono
COMPONENTS Irrlicht
CONFIG)
find_package(SDFormat REQUIRED)
find_package(Boost REQUIRED)
if (NOT Chrono_FOUND)
message("Could not find Chrono or one of its required modules")
return()
endif()
if(APPLE)
set(CMAKE_MACOSX_BUNDLE ON)
endif()
include_directories(${CHRONO_INCLUDE_DIRS})
include_directories(${Boost_INCLUDE_DIRS})
include_directories(${SDFormat_INCLUDE_DIRS})
include_directories(${PROJECT_SOURCE_DIR}/include)
link_directories(${SDFormat_LIBRARY_DIRS})
include(cmake/clang-format.cmake)
add_subdirectory(lib/)
add_subdirectory(include/)
add_subdirectory(examples/)