forked from NUbots/NUClearPortOld
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
62 lines (46 loc) · 1.93 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
58
59
60
61
62
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(Robocup)
SET(VERSION_MAJOR 0)
SET(VERSION_MINOR 2)
SET(VERSION_PATCH 0)
# Set to off to ignore building tests
OPTION(BUILD_TESTS "Builds all of the tests for each module." ON)
# We use additional modules that cmake needs to know about
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
# Our scripts directory contains shell scripts for running, generating, installing, etc
# not to be confused with robot scripts.
SET(NUBOTS_SCRIPTS_DIR "${CMAKE_SOURCE_DIR}/scripts/")
# Setup our compiler settings
INCLUDE("${CMAKE_SOURCE_DIR}/cmake/Includes/Compiler.cmake")
# Setup our shared includes
INCLUDE("${CMAKE_SOURCE_DIR}/cmake/Includes/SharedLibraries.cmake")
# Include our module builder
INCLUDE("${CMAKE_SOURCE_DIR}/cmake/Includes/NUClearModuleBuilder.cmake")
# Include our shared messages etc headers
INCLUDE_DIRECTORIES("shared")
INCLUDE_DIRECTORIES("build/shared")
# Build tests in test mode
IF(BUILD_TESTS)
ENABLE_TESTING()
ENDIF()
# This will generate any .proto files in the messages folder
ADD_SUBDIRECTORY(shared/messages)
# This will build our Utilities library (common functionality)
ADD_SUBDIRECTORY(shared/utility)
# Add these to our shared libraries (started in our shared libraries cmake)
SET(NUBOTS_SHARED_LIBRARIES ${NUBOTS_SHARED_LIBRARIES} messages utility)
# Find and build all our roles
ADD_SUBDIRECTORY(roles)
# Remove any duplicate modules (used in more then one role)
LIST(REMOVE_DUPLICATES modules)
# Build each of our modules and their corresponding tests
FOREACH(module ${modules})
STRING(REPLACE "::" "/" modulepath "${module}")
STRING(REPLACE "::" "" modulename "${module}")
# Add the subdirectories
ADD_SUBDIRECTORY(modules/${modulepath})
# Add the test
ADD_TEST(Test${modulename} modules/${modulepath}/Test${modulename})
ENDFOREACH()
# Include our scp darwin sender
INCLUDE("${CMAKE_SOURCE_DIR}/cmake/Includes/DarwinSend.cmake")