-
Notifications
You must be signed in to change notification settings - Fork 9
/
CMakeLists.txt
45 lines (37 loc) · 1.45 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.1.0)
project(client)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# Qt setup (needs to precede executable)
set(CMAKE_AUTOMOC on)
set(CMAKE_AUTORCC on)
set(CMAKE_AUTOUIC on)
set(CMAKE_INCLUDE_CURRENT_DIR on)
find_package(Qt5 COMPONENTS Core WebSockets REQUIRED)
list(APPEND Libs Qt5::Core Qt5::WebSockets)
add_executable(client src/main.cpp)
add_executable(test_client test/main.cpp)
add_subdirectory(src)
include_directories(include)
# find CMake packages for installed ROS packages
# this can be done for any catkin-based package
# https://github.com/gerkey/ros1_external_use/blob/master/ros1_msgs
find_package(roscpp REQUIRED)
include_directories(${roscpp_INCLUDE_DIRS})
list(APPEND Libs ${roscpp_LIBRARIES})
find_package(std_msgs REQUIRED)
include_directories(${std_msgs_INCLUDE_DIRS})
list(APPEND Libs ${std_msgs_LIBRARIES})
# custom target that builds amrl_msgs
add_custom_target(amrl_msgs
COMMAND ${CMAKE_COMMAND} -E env "ROS_PACKAGE_PATH=${CMAKE_CURRENT_SOURCE_DIR}/amrl_msgs:$ENV{ROS_PACKAGE_PATH}" make
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/amrl_msgs
)
include_directories(amrl_msgs/msg_gen/cpp/include)
include_directories(robofleet_client_lib)
include_directories(robofleet_client_lib/include)
add_dependencies(client amrl_msgs)
add_dependencies(test_client amrl_msgs)
add_subdirectory(googletest)
target_link_libraries(client ${Libs})
target_link_libraries(test_client ${Libs} gtest gtest_main)