Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/cpp fix for CMake < 3.3 #101

Merged
merged 1 commit into from
Sep 5, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions test/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
set(test_cpp_libs lcm-test-types-cpp lcm gtest gtest_main)
if(CMAKE_VERSION VERSION_LESS 3.3) # TODO remove when we require >=3.3
# NOTE: with CMake 3.3 or later, this is added as a dependency of the
# lcm-test-types-cpp INTERFACE target, so is not needed; CMake prior to
# 3.3 does not support dependencies on INTERFACE targets, and we need to
# enforce the build order for obvious reasons
list(APPEND test_cpp_libs lcm-test-types-generate-cpp)
endif()

add_executable(test-cpp-client client.cpp common.cpp)
target_link_libraries(test-cpp-client ${test_cpp_libs})

add_executable(test-cpp-memq_test memq_test.cpp common.cpp)
target_link_libraries(test-cpp-memq_test ${test_cpp_libs})

if(CMAKE_VERSION VERSION_LESS 3.3) # TODO remove when we require >=3.3
# NOTE: with CMake 3.3 or later, this is added as a dependency of the
# lcm-test-types-cpp INTERFACE target, so is not needed; CMake prior to
# 3.3 does not support dependencies on INTERFACE targets, and we need to
# enforce the build order for obvious reasons
add_dependencies(test-cpp-client lcm-test-types-generate-cpp)
add_dependencies(test-cpp-memq_test lcm-test-types-generate-cpp)
endif()

add_test(NAME CPP::memq_test COMMAND test-cpp-memq_test)

if(PYTHON_EXECUTABLE)
Expand Down