-
Notifications
You must be signed in to change notification settings - Fork 14
/
CMakeLists.txt
49 lines (39 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
cmake_minimum_required(VERSION 3.5)
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
set(CMAKE_DISABLE_SOURCE_CHANGES ON)
if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
message(SEND_ERROR "In-source builds are not allowed.")
endif ()
set(CMAKE_COLOR_MAKEFILE ON)
#execute_process(COMMAND ../scripts/make_types.sh)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
#set(CMAKE_VERBOSE_MAKEFILE ON)
option(MINI_CHEETAH_BUILD "use compiler flags for mini cheetah computer" OFF)
set(BUILD_TYPE_RELEASE TRUE)
if(MINI_CHEETAH_BUILD)
SET (THIS_COM "../" )
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake
${CMAKE_BINARY_DIR}/Configuration.h)
set(CMAKE_CXX_FLAGS "-O3 -no-pie -ggdb -Wall \
-Wextra -Wcast-align -Wdisabled-optimization -Wformat=2 \
-Winit-self -Wmissing-include-dirs -Woverloaded-virtual \
-Wshadow -Wsign-promo -Werror")
set(CMAKE_C_FLAGS "-O3 -ggdb -std=gnu99 -I.")
message(WARNING "set to mini cheetah build")
else(MINI_CHEETAH_BUILD)
SET (THIS_COM "${PROJECT_SOURCE_DIR}/" )
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake
${CMAKE_BINARY_DIR}/Configuration.h)
set(CMAKE_CXX_FLAGS "-O3 -no-pie -march=native -ggdb -Wall \
-Wextra -Wcast-align -Wdisabled-optimization -Wformat=2 \
-Winit-self -Wmissing-include-dirs -Woverloaded-virtual \
-Wshadow -Wsign-promo -Werror")
set(CMAKE_C_FLAGS "-O3 -ggdb -march=native -std=gnu99 -I.")
message(WARNING "not set to mini cheetah build. this won't work on the robot!")
endif(MINI_CHEETAH_BUILD)
set(CMAKE_CXX_STANDARD 14)
add_subdirectory(robot)
add_subdirectory(third-party)
add_subdirectory(common)
add_subdirectory(sim)
add_subdirectory(user)