Skip to content

Commit

Permalink
Install zenohc.dll in <prefix>/bin on Windows (#471)
Browse files Browse the repository at this point in the history
  • Loading branch information
traversaro authored and DenisBiryukov91 committed Jul 25, 2024
1 parent dcff1ce commit 0d9066f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion install/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,15 @@ function(install_zenohc_lib configurations property_postfix package_name)
get_filename_component(STATICLIB ${staticlib_path} NAME)

# Install dynamic, import and static library
install(FILES ${dylib_path} DESTINATION ${CMAKE_INSTALL_LIBDIR} CONFIGURATIONS ${configurations})

# On Windows .dll need to be installed in ${CMAKE_INSTALL_BINDIR},
# while on Linux and macOS .so and .dylib need to be installed in ${CMAKE_INSTALL_LIBDIR}
if(WIN32)
set(ZENOHC_INSTALL_DYLIBDIR ${CMAKE_INSTALL_BINDIR})
else()
set(ZENOHC_INSTALL_DYLIBDIR ${CMAKE_INSTALL_LIBDIR})
endif()
install(FILES ${dylib_path} DESTINATION ${ZENOHC_INSTALL_DYLIBDIR} CONFIGURATIONS ${configurations})
if(DEFINED implib_path)
install(FILES ${implib_path} DESTINATION ${CMAKE_INSTALL_LIBDIR} CONFIGURATIONS ${configurations})
endif()
Expand Down
2 changes: 1 addition & 1 deletion install/PackageConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if(NOT TARGET __zenohc_shared)
set_target_properties(__zenohc_shared PROPERTIES
IMPORTED_NO_SONAME TRUE
INTERFACE_COMPILE_DEFINITION ZENOHC_DYN_LIB
IMPORTED_LOCATION "${_IMPORT_PREFIX}/@CMAKE_INSTALL_LIBDIR@/@DYLIB@"
IMPORTED_LOCATION "${_IMPORT_PREFIX}/@ZENOHC_INSTALL_DYLIBDIR@/@DYLIB@"
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/@CMAKE_INSTALL_INCLUDEDIR@"
)
endif()
Expand Down

0 comments on commit 0d9066f

Please sign in to comment.