From da31ce23cac466ef4e8bf73cfef990675cd0f7d2 Mon Sep 17 00:00:00 2001 From: Denis Biryukov Date: Thu, 29 Aug 2024 11:42:15 +0200 Subject: [PATCH 1/2] use same name for debug and release packages --- README.md | 2 +- install/CMakeLists.txt | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5ff72b19a..5776155a3 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/install/CMakeLists.txt b/install/CMakeLists.txt index f297b5cdc..525b2de88 100644 --- a/install/CMakeLists.txt +++ b/install/CMakeLists.txt @@ -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) @@ -83,4 +82,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) From aa626588d6db43e14fbda4f5d1c09db1c8bb2eb3 Mon Sep 17 00:00:00 2001 From: Denis Biryukov Date: Thu, 29 Aug 2024 13:34:33 +0200 Subject: [PATCH 2/2] do not ovewrite zenohcConfig.cmake and and .pc with debug lib names --- install/CMakeLists.txt | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/install/CMakeLists.txt b/install/CMakeLists.txt index 525b2de88..95e932aa5 100644 --- a/install/CMakeLists.txt +++ b/install/CMakeLists.txt @@ -43,28 +43,36 @@ function(install_zenohc_lib configurations property_postfix package_name) # Generate 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 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()