Skip to content

Commit

Permalink
Merge branch 'main' into fixwininstalldir
Browse files Browse the repository at this point in the history
  • Loading branch information
traversaro authored Jul 18, 2024
2 parents 499478e + 9c25f8d commit 555ed5e
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 45 deletions.
54 changes: 27 additions & 27 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 23 additions & 17 deletions install/PackageConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,35 @@ if(_IMPORT_PREFIX STREQUAL "/")
set(_IMPORT_PREFIX "")
endif()

add_library(__zenohc_static STATIC IMPORTED GLOBAL)
add_library(zenohc::static ALIAS __zenohc_static)
target_link_libraries(__zenohc_static INTERFACE @NATIVE_STATIC_LIBS@)
set_target_properties(__zenohc_static PROPERTIES
IMPORTED_LOCATION "${_IMPORT_PREFIX}/@CMAKE_INSTALL_LIBDIR@/@STATICLIB@"
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/@CMAKE_INSTALL_INCLUDEDIR@"
)
if(NOT TARGET __zenohc_static)
add_library(__zenohc_static STATIC IMPORTED GLOBAL)
add_library(zenohc::static ALIAS __zenohc_static)
target_link_libraries(__zenohc_static INTERFACE @NATIVE_STATIC_LIBS@)
set_target_properties(__zenohc_static PROPERTIES
IMPORTED_LOCATION "${_IMPORT_PREFIX}/@CMAKE_INSTALL_LIBDIR@/@STATICLIB@"
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/@CMAKE_INSTALL_INCLUDEDIR@"
)
endif()

add_library(__zenohc_shared SHARED IMPORTED GLOBAL)
add_library(zenohc::shared ALIAS __zenohc_shared)
set_target_properties(__zenohc_shared PROPERTIES
IMPORTED_NO_SONAME TRUE
INTERFACE_COMPILE_DEFINITION ZENOHC_DYN_LIB
IMPORTED_LOCATION "${_IMPORT_PREFIX}/@ZENOHC_INSTALL_DYLIBDIR@/@DYLIB@"
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/@CMAKE_INSTALL_INCLUDEDIR@"
)
if(NOT TARGET __zenohc_shared)
add_library(__zenohc_shared SHARED IMPORTED GLOBAL)
add_library(zenohc::shared ALIAS __zenohc_shared)
set_target_properties(__zenohc_shared PROPERTIES
IMPORTED_NO_SONAME TRUE
INTERFACE_COMPILE_DEFINITION ZENOHC_DYN_LIB
IMPORTED_LOCATION "${_IMPORT_PREFIX}/@ZENOHC_INSTALL_DYLIBDIR@/@DYLIB@"
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/@CMAKE_INSTALL_INCLUDEDIR@"
)
endif()

if(NOT ("@IMPLIB@" STREQUAL ""))
set_property(TARGET __zenohc_shared PROPERTY IMPORTED_IMPLIB "${_IMPORT_PREFIX}/@CMAKE_INSTALL_LIBDIR@/@IMPLIB@")
endif()

if(ZENOHC_LIB_STATIC)
if(NOT TARGET zenohc::lib)
if(ZENOHC_LIB_STATIC)
add_library(zenohc::lib ALIAS __zenohc_static)
else()
else()
add_library(zenohc::lib ALIAS __zenohc_shared)
endif()
endif()
4 changes: 3 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ message(STATUS "zenoh-c tests")

add_custom_target(tests)

find_package(Threads REQUIRED)

file(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/*.c")
foreach(file ${files})
get_filename_component(target ${file} NAME_WE)
Expand All @@ -20,7 +22,7 @@ foreach(file ${files})
add_executable(${target} EXCLUDE_FROM_ALL ${file})
add_dependencies(tests ${target})
add_dependencies(${target} zenohc::lib)
target_link_libraries(${target} PRIVATE zenohc::lib)
target_link_libraries(${target} PRIVATE zenohc::lib Threads::Threads)
copy_dlls(${target})
set_property(TARGET ${target} PROPERTY C_STANDARD 11)
add_test(NAME "${test_type}_${target}" COMMAND ${target})
Expand Down

0 comments on commit 555ed5e

Please sign in to comment.