Skip to content

Commit

Permalink
Refs 11914. Update CMake framework
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>
  • Loading branch information
Miguel Barro committed Dec 5, 2021
1 parent b84dda0 commit 92e0e6b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ target_include_directories(${PROJECT_NAME} PUBLIC
${TINYXML2_INCLUDE_DIR}
$<$<BOOL:${ANDROID}>:${ANDROID_IFADDRS_INCLUDE_DIR}>
${THIRDPARTY_BOOST_INCLUDE_DIR}
${LIBP11_INCLUDE_DIR}
)

# No need to expose linked libs when target is a shared library on MSVC.
Expand All @@ -438,8 +439,9 @@ find_package(Atomic MODULE)
target_link_libraries(${PROJECT_NAME} ${PRIVACY} fastcdr foonathan_memory
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS}
${TINYXML2_LIBRARY}
$<$<BOOL:${LINK_SSL}>:OpenSSL::SSL$<SEMICOLON>OpenSSL::Crypto$<$<BOOL:${LINK_P11}>:$<SEMICOLON>p11>$<$<BOOL:${WIN32}>:$<SEMICOLON>crypt32.lib>>
$<$<BOOL:${LINK_SSL}>:OpenSSL::SSL$<SEMICOLON>OpenSSL::Crypto$<$<BOOL:${WIN32}>:$<SEMICOLON>crypt32.lib>>
$<$<BOOL:${WIN32}>:iphlpapi$<SEMICOLON>Shlwapi>
${LIBP11_LIBRARIES}
${THIRDPARTY_BOOST_LINK_LIBS}
PRIVATE eProsima_atomic
)
Expand Down
6 changes: 4 additions & 2 deletions test/blackbox/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,9 @@ if(FASTRTPS_API_TESTS)
)
target_include_directories(BlackboxTests_FastRTPS PRIVATE
${Asio_INCLUDE_DIR}
${LIBP11_INCLUDE_DIR}
api/fastrtps_deprecated)
target_link_libraries(BlackboxTests_FastRTPS fastrtps fastcdr foonathan_memory GTest::gtest)
target_link_libraries(BlackboxTests_FastRTPS fastrtps fastcdr foonathan_memory GTest::gtest ${LIBP11_LIBRARIES})
add_blackbox_gtest(BlackboxTests_FastRTPS SOURCES ${BLACKBOXTESTS_TEST_SOURCE}
ENVIRONMENTS "CERTS_PATH=${PROJECT_SOURCE_DIR}/test/certs"
"TOPIC_RANDOM_NUMBER=${TOPIC_RANDOM_NUMBER}"
Expand Down Expand Up @@ -318,8 +319,9 @@ if(FASTDDS_PIM_API_TESTS)
)
target_include_directories(BlackboxTests_DDS_PIM PRIVATE
${Asio_INCLUDE_DIR}
${LIBP11_INCLUDE_DIR}
api/dds-pim)
target_link_libraries(BlackboxTests_DDS_PIM fastrtps fastcdr foonathan_memory GTest::gtest)
target_link_libraries(BlackboxTests_DDS_PIM fastrtps fastcdr foonathan_memory GTest::gtest ${LIBP11_LIBRARIES})
add_blackbox_gtest(BlackboxTests_DDS_PIM SOURCES ${DDS_BLACKBOXTESTS_SOURCE}
ENVIRONMENTS "CERTS_PATH=${PROJECT_SOURCE_DIR}/test/certs"
"TOPIC_RANDOM_NUMBER=${TOPIC_RANDOM_NUMBER}"
Expand Down
2 changes: 2 additions & 0 deletions test/unittest/security/accesscontrol/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ target_include_directories(AccessControlTests PRIVATE
${OPENSSL_INCLUDE_DIR}
${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include
${PROJECT_SOURCE_DIR}/src/cpp
${LIBP11_INCLUDE_DIR}
)

target_link_libraries(AccessControlTests
Expand All @@ -94,6 +95,7 @@ target_link_libraries(AccessControlTests
foonathan_memory
$<$<BOOL:${WIN32}>:ws2_32>
${TINYXML2_LIBRARY}
${LIBP11_LIBRARIES}
)

if(MSVC OR MSVC_IDE)
Expand Down
10 changes: 9 additions & 1 deletion test/unittest/security/authentication/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,16 @@ target_include_directories(BuiltinPKIDH PRIVATE
${OPENSSL_INCLUDE_DIR}
${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include
${PROJECT_SOURCE_DIR}/src/cpp
${LIBP11_INCLUDE_DIR}
)
target_link_libraries(BuiltinPKIDH
GTest::gtest
${OPENSSL_LIBRARIES}
fastcdr
foonathan_memory
$<$<BOOL:${WIN32}>:ws2_32>
${LIBP11_LIBRARIES}
)
target_link_libraries(BuiltinPKIDH GTest::gtest ${OPENSSL_LIBRARIES} fastcdr foonathan_memory $<$<BOOL:${WIN32}>:ws2_32>)
add_gtest(BuiltinPKIDH
SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/BuiltinPKIDHTests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/AuthenticationPluginTests.hpp
Expand Down

0 comments on commit 92e0e6b

Please sign in to comment.