From 846fb43a292e386c20ec41a7769aed11f0323216 Mon Sep 17 00:00:00 2001 From: Antonio cuadros Date: Tue, 18 May 2021 08:11:47 +0200 Subject: [PATCH] Add link_directories --- test/test/client_agent/CMakeLists.txt | 4 +--- test/test/interaction_client/CMakeLists.txt | 4 ++-- test/test/multithread/CMakeLists.txt | 5 +---- test/test/publisher_subscriber/CMakeLists.txt | 1 + 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/test/test/client_agent/CMakeLists.txt b/test/test/client_agent/CMakeLists.txt index 26ac4ac..d4f4ff0 100644 --- a/test/test/client_agent/CMakeLists.txt +++ b/test/test/client_agent/CMakeLists.txt @@ -21,9 +21,6 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/DEFAULT_FASTRTPS_PROFILES.xml.in add_executable(client-agent-test ClientAgentInteraction.cpp) -add_dependencies(client-agent-test interaction_client) -set_property(TARGET interaction_client PROPERTY IMPORTED_LOCATION ${PROJECT_BINARY_DIR}/test/interaction_client/lib_interaction_client.a) - add_gtest(client-agent-test SOURCES ClientAgentInteraction.cpp @@ -37,6 +34,7 @@ target_include_directories(client-agent-test ${GTEST_INCLUDE_DIR} ) +link_directories(${PROJECT_BINARY_DIR}/test/interaction_client) target_link_libraries(client-agent-test PRIVATE interaction_client diff --git a/test/test/interaction_client/CMakeLists.txt b/test/test/interaction_client/CMakeLists.txt index a098f0b..c0ff498 100644 --- a/test/test/interaction_client/CMakeLists.txt +++ b/test/test/interaction_client/CMakeLists.txt @@ -32,7 +32,7 @@ find_library(CLIENT microxrcedds_client REQUIRED HINTS ${PROJECT_BINARY_DIR}/../../../temp_install/lib/libmicroxrcedds_client.a) if(UXRCE_TEST_THREAD) - list(APPEND libs thread_interaction_client) + list(APPEND libs interaction_thread_client) find_library(CLIENT_MULTITHREAD thread_microxrcedds_client REQUIRED HINTS ${PROJECT_BINARY_DIR}/../../../temp_install/lib/libthread_microxrcedds_client.a) endif() @@ -67,7 +67,7 @@ foreach(lib ${libs}) PRIVATE ${GTEST_BOTH_LIBRARIES} ) - elseif(${lib} STREQUAL thread_interaction_client) + elseif(${lib} STREQUAL interaction_thread_client) target_link_libraries(${lib} PUBLIC ${CLIENT_MULTITHREAD} diff --git a/test/test/multithread/CMakeLists.txt b/test/test/multithread/CMakeLists.txt index 3f0c886..238556b 100644 --- a/test/test/multithread/CMakeLists.txt +++ b/test/test/multithread/CMakeLists.txt @@ -16,9 +16,6 @@ cmake_host_system_information(RESULT HOSTNAME_SUFFIX QUERY HOSTNAME) add_executable(client-thread-test ClientAgentInteractionThread.cpp) -add_dependencies(client-thread-test thread_interaction_client) -set_property(TARGET thread_interaction_client PROPERTY IMPORTED_LOCATION ${PROJECT_BINARY_DIR}/test/interaction_client/libthread_interaction_client.a) - add_gtest(client-thread-test SOURCES ClientAgentInteractionThread.cpp @@ -35,7 +32,7 @@ target_include_directories(client-thread-test target_link_libraries(client-thread-test PRIVATE - thread_interaction_client + interaction_thread_client microxrcedds_agent ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} diff --git a/test/test/publisher_subscriber/CMakeLists.txt b/test/test/publisher_subscriber/CMakeLists.txt index 8a59635..76819ad 100644 --- a/test/test/publisher_subscriber/CMakeLists.txt +++ b/test/test/publisher_subscriber/CMakeLists.txt @@ -34,6 +34,7 @@ target_include_directories(publisher-subscriber-interaction-test ${GTEST_INCLUDE_DIR} ) +link_directories(${PROJECT_BINARY_DIR}/test/interaction_client) target_link_libraries(publisher-subscriber-interaction-test PRIVATE interaction_client