diff --git a/test_security/CMakeLists.txt b/test_security/CMakeLists.txt index da614b67..8a552781 100644 --- a/test_security/CMakeLists.txt +++ b/test_security/CMakeLists.txt @@ -256,6 +256,11 @@ if(BUILD_TESTING) set(ENV_PATH "$ENV{PATH}") file(TO_CMAKE_PATH "${ENV_PATH}" ENV_PATH) set(TEST_PATH "${ENV_PATH}") + set(append_library_dirs "${CMAKE_CURRENT_BINARY_DIR}") + if(WIN32) + set(append_library_dirs "${append_library_dirs}/$") + endif() + if(rmw_implementation STREQUAL "rmw_connext_cpp") # Connext 5.3.1 needs RTI's OpenSSL binaries (based on EOL 1.0.2) to be # on the PATH at runtime as the system version of OpenSSL is not supported @@ -316,11 +321,6 @@ if(BUILD_TESTING) custom_executable(test_secure_subscriber_cpp "test/test_secure_subscriber.cpp") - set(append_library_dirs "${CMAKE_CURRENT_BINARY_DIR}") - if(WIN32) - set(append_library_dirs "${append_library_dirs}/$") - endif() - # finding gtest once in the highest scope # prevents finding it repeatedly in each local scope ament_find_gtest()