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..95e932aa5 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) @@ -44,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() @@ -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)