Skip to content

Commit

Permalink
Merge pull request #629 from DenisBiryukov91/dev/same_name_for_debug_…
Browse files Browse the repository at this point in the history
…and_release_packages

use same name for debug and release packages
  • Loading branch information
milyin authored Aug 29, 2024
2 parents fe8051a + aa62658 commit cde7501
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ This repository provides a C binding based on the main [Zenoh implementation wri
- `zenohc::static` for linking static library
- `zenohc::lib` for linking static or dynamic library depending on boolean variable `ZENOHC_LIB_STATIC`

For `Debug` configuration the library package `zenohc_debug` is installed side-by-side with release `zenohc` library. Suffix `d` is added to names of library files (libzenohc**d**.so).
For `Debug` configuration suffix `d` is added to names of library files (libzenohc**d**.so).

5. VScode

Expand Down
25 changes: 16 additions & 9 deletions install/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ declare_cache_var(ZENOHC_INSTALL_STATIC_LIBRARY FALSE BOOL "Install zenoh-c stat

#
# Installation
# For debug configuration installs libraries with 'd' added to filename and
# package named 'zenohc_debug'
# For debug configuration installs libraries with 'd' added to filename
#
status_print(CMAKE_INSTALL_PREFIX)

Expand Down Expand Up @@ -44,28 +43,36 @@ function(install_zenohc_lib configurations property_postfix package_name)
# Generate <Package>Config.cmake
configure_package_config_file(
"PackageConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/${package_name}Config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/${package_name}_${property_postfix}Config.cmake"
INSTALL_DESTINATION "${CMAKE_INSTALL_CMAKEDIR}")

# Generate <Package>Version.cmake
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/${package_name}ConfigVersion.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/${package_name}_${property_postfix}ConfigVersion.cmake"
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion)

install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/${package_name}Config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/${package_name}ConfigVersion.cmake"
FILES "${CMAKE_CURRENT_BINARY_DIR}/${package_name}_${property_postfix}Config.cmake"
DESTINATION "${CMAKE_INSTALL_CMAKEDIR}"
CONFIGURATIONS ${configurations}
RENAME ${package_name}Config.cmake
COMPONENT dev)

install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/${package_name}_${property_postfix}ConfigVersion.cmake"
DESTINATION "${CMAKE_INSTALL_CMAKEDIR}"
CONFIGURATIONS ${configurations}
RENAME ${package_name}ConfigVersion.cmake
COMPONENT dev)

if(APPLE OR UNIX)
get_filename_component(LIBNAME ${DYLIB} NAME_WE)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/zenohc.pc.in ${CMAKE_CURRENT_BINARY_DIR}/${package_name}.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${package_name}.pc
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/zenohc.pc.in ${CMAKE_CURRENT_BINARY_DIR}/${package_name}_${property_postfix}.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${package_name}_${property_postfix}.pc
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
CONFIGURATIONS ${configurations}
RENAME ${package_name}.pc
OPTIONAL)
endif()
endfunction()
Expand All @@ -83,4 +90,4 @@ endforeach()
# Install lib files
#
install_zenohc_lib("Release;RelWithDebInfo;MinSizeRel;None" "RELEASE" zenohc)
install_zenohc_lib("Debug" "DEBUG" zenohc_debug)
install_zenohc_lib("Debug" "DEBUG" zenohc)

0 comments on commit cde7501

Please sign in to comment.