-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
45 lines (35 loc) · 1.2 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
cmake_minimum_required(VERSION 3.7)
project(micromouse-maze)
set(CMAKE_LEGACY_CYGWIN_WIN32 0)
#set(CMAKE_CXX_FLAGS " -std=gnu++0x")
#add_definitions(-std=gnu++0x)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_STANDARD 11)
set(COMMON_FLAGS " -Wall -Wextra ")
set(HEADER_COMMENTS 1)
set(CMAKE_C_FLAGS "${COMMON_FLAGS} ")
set(CMAKE_CXX_FLAGS "${COMMON_FLAGS} ")
set(SOURCE_FILES
main.cpp
)
add_executable(libmaze_run
${SOURCE_FILES}
)
# places to look for include files
include_directories(
libMaze
oldmaze
)
# adds in the CMakeLists files from these directories
add_subdirectory(libMaze)
add_subdirectory(tests)
# list the libraries needed by the target named
target_link_libraries(libmaze_run maze)
# before building, run astyle over all the sources to be sure
# the formatting is always consistent
add_custom_command(TARGET libmaze_run PRE_BUILD
COMMENT "Pre build: reformat with astyle\n"
COMMAND astyle -nQv --project=.astylerc \"${PROJECT_SOURCE_DIR}/*.cpp\"
COMMAND astyle -nQv --project=.astylerc \"${PROJECT_SOURCE_DIR}/libMaze/*.cpp\"
COMMAND astyle -nQv --project=.astylerc \"${PROJECT_SOURCE_DIR}/libMaze/*.h\"
)