-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
executable file
·59 lines (49 loc) · 1.74 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
# Distributed under the OpenDDS License. See accompanying LICENSE
# file or http://www.opendds.org/license.html for details.
#
project(OpenDDS_Messenger1_cmake CXX)
cmake_minimum_required(VERSION 3.8.2)
# set(CMAKE_CXX_STANDARD 11) //Not supported
SET(GCC_COVERAGE_LINK_FLAGS "-lboost_ program_options -lboost_timer -lboost_chrono -lrt")
find_package(OpenDDS)
find_package(Boost REQUIRED)
FIND_PACKAGE(Boost COMPONENTS program_options REQUIRED)
find_package(Boost REQUIRED filesystem program_options timer chrono)
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
set(src "${CMAKE_CURRENT_SOURCE_DIR}")
set(dst ${CMAKE_CURRENT_BINARY_DIR})
set(all_targets initiator echoer)
# Initiator
add_executable(initiator
${src}/publisher.cpp
)
OPENDDS_TARGET_SOURCES(initiator
${src}/Messenger.idl
)
# Echoer
add_executable(echoer
${src}/subscriber.cpp
)
OPENDDS_TARGET_SOURCES(echoer
${src}/DataReaderListener.cpp
${src}/DataReaderListener.h
${src}/Messenger.idl
)
foreach(t ${all_targets})
target_link_libraries(${t} OpenDDS::OpenDDS ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_DATE_TIME_LIBRARY} ${Boost_LIBRARIES})
endforeach()
# Copy configs/scripts into build-output directory
if (EXISTS ${DDS_ROOT}/tests/DCPS/Messenger)
file(GLOB ini "${DDS_ROOT}/tests/DCPS/Messenger/*.ini")
file(GLOB pl "${DDS_ROOT}/tests/DCPS/Messenger/*.pl")
file(GLOB xml "${DDS_ROOT}/tests/DCPS/Messenger/*.xml")
file(GLOB p7s "${DDS_ROOT}/tests/DCPS/Messenger/*.p7s")
add_custom_target(Copy_ini_and_scripts
ALL
COMMAND_EXPAND_LISTS
VERBATIM
COMMENT "Copying configs/scripts into build-output directory"
COMMAND ${CMAKE_COMMAND} -E copy ${ini} ${pl} ${xml} ${p7s} ${dst}/$<CONFIG>
)
add_dependencies(Copy_ini_and_scripts ${all_targets})
endif()