-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
82 lines (65 loc) · 2.63 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# \file CMakeLists.txt
# \author Antoine Dozois <[email protected]>
# \date 10/16/2015
# \copyright 2015 Club SONIA AUV, ETS. All rights reserved.
# Use of this source code is governed by the MIT license that can be
# found in the LICENSE file.
#===============================================================================
# G L O B A L P R O J E C T C O N F I G U R A T I O N
cmake_minimum_required(VERSION 3.0.2)
project(provider_power)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug CACHE STRING
"Choose the type of build: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
endif (NOT CMAKE_BUILD_TYPE)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++11")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++11 -O3")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
#===============================================================================
# C A T K I N C O N F I G U R A T I O N
find_package( catkin REQUIRED COMPONENTS
roscpp
std_msgs
sonia_common
)
# Declare this project as a catkin package and export the necessary build flags
catkin_package(
INCLUDE_DIRS src
LIBRARIES
CATKIN_DEPENDS
roscpp
std_msgs
sonia_common
)
#===============================================================================
# I N C L U D E F I L E S
set(provider_power_INCLUDE_DIRS "src")
set(provider_power_SRC_DIR "src/provider_power")
file(GLOB_RECURSE provider_power_FILES
"${provider_power_SRC_DIR}/*.cc"
"${provider_power_SRC_DIR}/*.h")
list(REMOVE_ITEM provider_power_FILES
${CMAKE_CURRENT_SOURCE_DIR}/${provider_power_SRC_DIR}/main.cc)
# Include all the directories where source can be found.
include_directories(
${provider_power_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}
)
#==========================================================================
# C R E A T E E X E C U T A B L E
set( TARGET_NAME provider_power_node )
add_executable( ${TARGET_NAME}
${provider_power_SRC_DIR}/main.cc
${provider_power_SRC_DIR}/provider_power_node.cc)
target_link_libraries( ${TARGET_NAME} ${catkin_LIBRARIES})
set_target_properties( ${TARGET_NAME} PROPERTIES LINKER_LANGUAGE CXX )
add_dependencies(${PROJECT_NAME}_node ${catkin_EXPORTED_TARGETS})
#==========================================================================
# U N I T T E S T S
# uncomment for test
#if (${CATKIN_ENABLE_TESTING})
# add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/test)
#endif ()