Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix find_package #548

Merged
merged 3 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,11 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/zenoh-pico
DESTINATION include
COMPONENT Headers
)
if(BUILD_SHARED_LIBS)
set(LIBNAME ${CMAKE_SHARED_LIBRARY_PREFIX}${Libname}${CMAKE_SHARED_LIBRARY_SUFFIX})
else()
set(LIBNAME ${CMAKE_STATIC_LIBRARY_PREFIX}${Libname}${CMAKE_STATIC_LIBRARY_SUFFIX})
endif()

set(CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/zenohpico")
# Generate <Package>Config.cmake
Expand Down
30 changes: 20 additions & 10 deletions PackageConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,28 @@

@PACKAGE_INIT@

add_library(__zenohpico_static STATIC IMPORTED GLOBAL)
add_library(zenohpico::static ALIAS __zenohpico_static)
set_property(TARGET __zenohpico_static PROPERTY IMPORTED_LOCATION "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/@STATICLIB@")
set(ZENOHPICO_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
set(CMAKE_SYSTEM_NAME @CMAKE_SYSTEM_NAME@)

add_library(__zenohpico_lib SHARED IMPORTED GLOBAL)
add_library(zenohpico::lib ALIAS __zenohpico_lib)
set_target_properties(__zenohpico_lib PROPERTIES IMPORTED_NO_SONAME TRUE)
set_property(TARGET __zenohpico_lib PROPERTY IMPORTED_LOCATION "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/@DYLIB@")
if(NOT ("@IMPLIB@" STREQUAL ""))
set_property(TARGET __zenohpico_lib PROPERTY IMPORTED_IMPLIB "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/@IMPLIB@")
if(ZENOHPICO_BUILD_SHARED_LIBS)
if (NOT TARGET __zenohpico_lib)
add_library(__zenohpico_lib SHARED IMPORTED GLOBAL)
add_library(zenohpico::lib ALIAS __zenohpico_lib)
set_target_properties(__zenohpico_lib PROPERTIES IMPORTED_NO_SONAME TRUE)
set_property(TARGET __zenohpico_lib PROPERTY IMPORTED_LOCATION "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/@LIBNAME@")
if(NOT ("@IMPLIB@" STREQUAL ""))
set_property(TARGET __zenohpico_lib PROPERTY IMPORTED_IMPLIB "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/@IMPLIB@")
endif()
target_include_directories(__zenohpico_lib INTERFACE "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@")
endif()
else()
if (NOT TARGET __zenohpico_static)
add_library(__zenohpico_static STATIC IMPORTED GLOBAL)
add_library(zenohpico::lib ALIAS __zenohpico_static)
set_property(TARGET __zenohpico_static PROPERTY IMPORTED_LOCATION "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/@LIBNAME@")
target_include_directories(__zenohpico_static INTERFACE "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@")
endif()
endif()
target_include_directories(__zenohpico_lib INTERFACE "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@")

if(CMAKE_SYSTEM_NAME MATCHES "Linux")
add_compile_definitions(ZENOH_LINUX)
Expand Down
2 changes: 1 addition & 1 deletion zenohpico.pc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ prefix=/usr/local
Name: zenohpico
Description:
URL:
Version: 1.0.20240715dev
Version: 1.0.20240719dev
Cflags: -I${prefix}/include
Libs: -L${prefix}/lib -lzenohpico
Loading