-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
100 lines (87 loc) · 2.54 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
cmake_minimum_required(VERSION 2.8.3)
project(ensenso_nx)
message(STATUS "Executig CMakeLists of project ${PROJECT_NAME}.")
# DEBUG/RELEASE
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "RELEASE")
endif (NOT CMAKE_BUILD_TYPE)
message(STATUS "Configured to compile in ${CMAKE_BUILD_TYPE} mode.")
set(CMAKE_CXX_FLAGS_DEBUG "-g -Wall -D_REENTRANT")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -D_REENTRANT")
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has C++11 support.")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has C++0x support.")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
else()
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()
find_package(
catkin REQUIRED
COMPONENTS
roscpp
rospy
dynamic_reconfigure
std_msgs
sensor_msgs
pcl_ros
pcl_conversions
)
find_package(PCL 1.3 REQUIRED COMPONENTS)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "$ENV{ENSENSO_INSTALL}/cmake/")
find_package(Ensenso REQUIRED)
include_directories(${ENSENSO_INCLUDE_DIRS})
message(STATUS "Ensenso Headers found at ${ENSENSO_INCLUDE_DIRS}.")
message(STATUS "Ensenso Libraries found at ${ENSENSO_LIBRARIES}.")
include_directories(
include
${catkin_INCLUDE_DIRS}
)
generate_dynamic_reconfigure_options(cfg/EnsensoNxParams.cfg)
catkin_package(
CATKIN_DEPENDS
roscpp
rospy
dynamic_reconfigure
std_msgs
sensor_msgs
pcl_ros
pcl_conversions
)
add_library(${PROJECT_NAME}_lib SHARED
src/${PROJECT_NAME}/ensenso_nx.cpp
)
target_link_libraries(${PROJECT_NAME}_lib
${ENSENSO_LIBRARIES}
${PCL_COMMON_LIBRARIES}
${PCL_IO_LIBRARIES}
)
add_library(${PROJECT_NAME}_node SHARED
src/${PROJECT_NAME}/ensenso_nx_node.cpp
)
add_dependencies(${PROJECT_NAME}_node
${PROJECT_NAME}_lib
${${PROJECT_NAME}_EXPORTED_TARGETS}
${PROJECT_NAME}_gencfg
${catkin_EXPORTED_TARGETS}
)
target_link_libraries(${PROJECT_NAME}_node
${PROJECT_NAME}_lib
${catkin_LIBRARIES}
)
add_executable(${PROJECT_NAME}
src/ensenso_nx_node_main.cpp
)
add_dependencies(${PROJECT_NAME}
${PROJECT_NAME}_lib
)
target_link_libraries(${PROJECT_NAME}
${PROJECT_NAME}_node
)