forked from OpenDDS/OpenDDS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for C++11 Mapping in the CMake Module
Fix for OpenDDS#1714 Support for the C++11 mapping in the CMake module. `-Lc++11` can now be passed with `OPENDDS_IDL_OPTIONS` in `OPENDDS_TARGET_SOURCES`. Also added a property to the target of `OPENDDS_TARGET_SOURCES` called `OPENDDS_LANGUAGE_MAPPING` that states what mapping was used. This will be exported if supported by CMake. Fix for OpenDDS/pyopendds#9.
- Loading branch information
1 parent
e1b3c99
commit b901737
Showing
11 changed files
with
147 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
54 changes: 54 additions & 0 deletions
54
tests/cmake_integration/Messenger/C++11_Messenger/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
project(OpenDDS_DevGuide_Messenger CXX) | ||
cmake_minimum_required(VERSION 3.8.2) | ||
|
||
find_package(OpenDDS REQUIRED) | ||
|
||
set(CMAKE_CXX_COMPILER ${OPENDDS_COMPILER}) | ||
set(target_prefix "opendds_cmake_cpp11_messenger_") | ||
set(src "${CMAKE_CURRENT_SOURCE_DIR}/../../../DCPS/C++11/Messenger") | ||
set(dst ${CMAKE_CURRENT_BINARY_DIR}) | ||
set(opendds_libs | ||
OpenDDS::Dcps | ||
OpenDDS::InfoRepoDiscovery OpenDDS::Tcp | ||
) | ||
|
||
# IDL Library | ||
set(idl "${target_prefix}idl") | ||
add_library(${idl}) | ||
OPENDDS_TARGET_SOURCES(${idl} "${src}/Idl/Messenger.idl" OPENDDS_IDL_OPTIONS "-Lc++11") | ||
target_link_libraries(${idl} PUBLIC OpenDDS::Dcps) | ||
|
||
# Assert the mapping used was C++11 | ||
get_property(mappings TARGET ${idl} PROPERTY OPENDDS_LANGUAGE_MAPPINGS) | ||
if(NOT ("C++11" IN_LIST mappings)) | ||
message(FATAL_ERROR "${idl}: C++11 NOT in mapping list: ${mappings}") | ||
endif() | ||
export( | ||
TARGETS ${idl} | ||
FILE "${CMAKE_CURRENT_BINARY_DIR}/MessengerIdlConfig.cmake" | ||
) | ||
|
||
# Publisher | ||
set(publisher "${target_prefix}publisher") | ||
add_executable(${publisher} | ||
"${src}/Publisher/publisher.cpp" | ||
) | ||
set_target_properties(${publisher} PROPERTIES | ||
OUTPUT_NAME "publisher" | ||
RUNTIME_OUTPUT_DIRECTORY "${dst}/Publisher" | ||
) | ||
target_link_libraries(${publisher} ${opendds_libs} ${idl}) | ||
|
||
# Subscriber | ||
set(subscriber "${target_prefix}subscriber") | ||
add_executable(${subscriber} | ||
"${src}/Subscriber/subscriber.cpp" | ||
) | ||
set_target_properties(${subscriber} PROPERTIES | ||
OUTPUT_NAME "subscriber" | ||
RUNTIME_OUTPUT_DIRECTORY "${dst}/Subscriber" | ||
) | ||
target_link_libraries(${subscriber} ${opendds_libs} ${idl}) | ||
|
||
# run_test.pl | ||
configure_file("${src}/run_test.pl" "${dst}/run_test.pl" COPYONLY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters