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.
Merge pull request OpenDDS#4316 from tmayoff/cmake_tests
Add some tests to cmake
- Loading branch information
Showing
5 changed files
with
123 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
cmake_minimum_required(VERSION 3.8...3.27) | ||
project(opendds_compiler_char_literals CXX) | ||
enable_testing() | ||
|
||
find_package(OpenDDS REQUIRED) | ||
include(opendds_testing) | ||
|
||
set(target_prefix "${PROJECT_NAME}_") | ||
set(dst ${CMAKE_CURRENT_BINARY_DIR}) | ||
set(opendds_libs | ||
OpenDDS::Dcps | ||
) | ||
|
||
# IDL Library | ||
set(idl "${target_prefix}idl") | ||
add_library(${idl}) | ||
opendds_target_sources(${idl} PUBLIC "test.idl" OPENDDS_IDL_OPTIONS "-Lc++11") | ||
target_link_libraries(${idl} PUBLIC OpenDDS::Dcps) | ||
set(idl_dir "${dst}/cpp11") | ||
set_target_properties(${idl} PROPERTIES | ||
RUNTIME_OUTPUT_DIRECTORY "${idl_dir}" | ||
LIBRARY_OUTPUT_DIRECTORY "${idl_dir}" | ||
) | ||
|
||
add_executable(opendds_compiler_char_literals_exe | ||
"main.cpp" | ||
) | ||
set_target_properties(opendds_compiler_char_literals_exe PROPERTIES | ||
OUTPUT_NAME char-literals-cpp11 | ||
RUNTIME_OUTPUT_DIRECTORY "${dst}/cpp11" | ||
) | ||
target_link_libraries(opendds_compiler_char_literals_exe ${opendds_libs} ${idl} gtest) | ||
|
||
configure_file(run_test.pl . COPYONLY) | ||
opendds_add_test(COMMAND perl run_test.pl cpp11 EXTRA_LIB_DIRS "${idl_dir}") |
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,47 @@ | ||
cmake_minimum_required(VERSION 3.3...3.27) | ||
project(opendds_hello_world CXX) | ||
enable_testing() | ||
|
||
find_package(OpenDDS REQUIRED) | ||
include(opendds_testing) | ||
|
||
set(target_prefix "${PROJECT_NAME}_") | ||
|
||
# IDL TypeSupport Library | ||
set(idl "${target_prefix}idl") | ||
add_library(${idl}) | ||
opendds_target_sources(${idl} PUBLIC "HelloWorld.idl") | ||
target_link_libraries(${idl} PUBLIC OpenDDS::Dcps) | ||
|
||
set(opendds_libs | ||
OpenDDS::Dcps # Core OpenDDS Library | ||
OpenDDS::InfoRepoDiscovery OpenDDS::Tcp # For run_test.pl | ||
OpenDDS::Rtps OpenDDS::Rtps_Udp # For run_test.pl --rtps | ||
${idl} | ||
) | ||
|
||
# Publisher | ||
set(publisher "${target_prefix}publisher") | ||
add_executable(${publisher} | ||
publisher.cpp | ||
) | ||
target_link_libraries(${publisher} ${opendds_libs}) | ||
set_target_properties(${publisher} PROPERTIES | ||
OUTPUT_NAME publisher | ||
) | ||
|
||
# Subscriber | ||
set(subscriber "${target_prefix}subscriber") | ||
add_executable(${subscriber} | ||
subscriber.cpp | ||
) | ||
target_link_libraries(${subscriber} ${opendds_libs}) | ||
set_target_properties(${subscriber} PROPERTIES | ||
OUTPUT_NAME subscriber | ||
) | ||
|
||
# Testing | ||
configure_file(run_test.pl . COPYONLY) | ||
configure_file(rtps.ini . COPYONLY) | ||
opendds_add_test(NAME info_repo COMMAND perl run_test.pl) | ||
opendds_add_test(NAME rtps COMMAND perl run_test.pl ini=rtps.ini) |
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