Skip to content

Commit

Permalink
Add link_directories
Browse files Browse the repository at this point in the history
  • Loading branch information
Acuadros95 committed May 18, 2021
1 parent 12a785d commit 846fb43
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
4 changes: 1 addition & 3 deletions test/test/client_agent/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/test/interaction_client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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}
Expand Down
5 changes: 1 addition & 4 deletions test/test/multithread/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}
Expand Down
1 change: 1 addition & 0 deletions test/test/publisher_subscriber/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 846fb43

Please sign in to comment.