-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
103 lines (85 loc) · 3.21 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
101
102
103
cmake_minimum_required(VERSION 3.1)
PROJECT(example C)
set(SOURCE_EXTENSION_C c)
set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/objs/${RTIME_TARGET_NAME})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/objs/${RTIME_TARGET_NAME})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/objs/${RTIME_TARGET_NAME})
set(RTI_LIB_PREFIX rti_me)
set(RTI_LIB_SUFFIX)
if (NOT (DEFINED RTI_SHARED_LIB))
if (${CMAKE_BUILD_TYPE} MATCHES "[Rr]elease")
set(RTI_LIB_SUFFIX "z")
set(RTI_DEBUG_BUILD FALSE)
add_definitions(-DNDEBUG)
else()
set(RTI_LIB_SUFFIX "zd")
set(RTI_DEBUG_BUILD TRUE)
endif()
else()
if(${CMAKE_BUILD_TYPE} MATCHES "[Rr]elease")
set(RTI_LIB_SUFFIX "")
set(RTI_DEBUG_BUILD FALSE)
ADD_DEFINITIONS(-DNDEBUG)
else()
set(RTI_LIB_SUFFIX "d")
set(RTI_DEBUG_BUILD TRUE)
endif()
endif()
set(IDL_GEN_C
${CMAKE_CURRENT_SOURCE_DIR}/example.${SOURCE_EXTENSION_C}
${CMAKE_CURRENT_SOURCE_DIR}/examplePlugin.${SOURCE_EXTENSION_C}
${CMAKE_CURRENT_SOURCE_DIR}/exampleSupport.${SOURCE_EXTENSION_C}
)
set(IDL_GEN_H
${CMAKE_CURRENT_SOURCE_DIR}/example.h
${CMAKE_CURRENT_SOURCE_DIR}/examplePlugin.h
${CMAKE_CURRENT_SOURCE_DIR}/exampleSupport.h
)
set(MICRO_C_LIBS
rti_me_rhsm${RTI_LIB_SUFFIX}
rti_me_whsm${RTI_LIB_SUFFIX}
rti_me_discdpse${RTI_LIB_SUFFIX}
rti_me${RTI_LIB_SUFFIX}
)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
$ENV{RTIMEHOME}/include
)
link_directories($ENV{RTIMEHOME}/lib/${RTIME_TARGET_NAME})
################################################################################
# example_subscriber_1
################################################################################
add_executable(example_subscriber_1
${CMAKE_CURRENT_SOURCE_DIR}/example_subscriber_1.${SOURCE_EXTENSION_C}
${IDL_GEN_C}
${IDL_GEN_H}
)
target_link_libraries(example_subscriber_1 ${MICRO_C_LIBS} ${PLATFORM_LIBS})
################################################################################
# example_subscriber_2
################################################################################
add_executable(example_subscriber_2
${CMAKE_CURRENT_SOURCE_DIR}/example_subscriber_2.${SOURCE_EXTENSION_C}
${IDL_GEN_C}
${IDL_GEN_H}
)
target_link_libraries(example_subscriber_2 ${MICRO_C_LIBS} ${PLATFORM_LIBS})
################################################################################
# example_subscriber_3
################################################################################
add_executable(example_subscriber_3
${CMAKE_CURRENT_SOURCE_DIR}/example_subscriber_3.${SOURCE_EXTENSION_C}
${IDL_GEN_C}
${IDL_GEN_H}
)
target_link_libraries(example_subscriber_3 ${MICRO_C_LIBS} ${PLATFORM_LIBS})
################################################################################
# example_publisher
################################################################################
add_executable(example_publisher
${CMAKE_CURRENT_SOURCE_DIR}/example_publisher.${SOURCE_EXTENSION_C}
${IDL_GEN_C}
${IDL_GEN_H}
)
target_link_libraries(example_publisher ${MICRO_C_LIBS} ${PLATFORM_LIBS})