diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e58b1460b..b0eeccaf7c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -342,10 +342,9 @@ endif() # --------------------------------------------------------------------------------------- if(SPDLOG_INSTALL) message(STATUS "Generating install") - if(DEFINED XP_NAMESPACE) + if(COMMAND xpExternPackage) set(targetsFile "spdlogConfigTargets") - xpExternPackage(NAMESPACE ${XP_NAMESPACE} ALIAS_NAMESPACE spdlog - TARGETS_FILE ${targetsFile} LIBRARIES spdlog spdlog_header_only + xpExternPackage(TARGETS_FILE ${targetsFile} LIBRARIES spdlog spdlog_header_only BASE v${SPDLOG_VERSION} XPDIFF "patch" FIND_THREADS DEPS fmt WEB "https://github.com/gabime/spdlog/wiki" UPSTREAM "github.com/gabime/spdlog" DESC "Fast C++ logging library" @@ -353,9 +352,7 @@ if(SPDLOG_INSTALL) ) set(config_targets_file "${targetsFile}.cmake") set(export_dest_dir "${CMAKE_INSTALL_CMAKEDIR}") - set(CMAKE_NAMESPACE ${XP_NAMESPACE}) else() - set(CMAKE_NAMESPACE spdlog) set(project_config_in "${CMAKE_CURRENT_LIST_DIR}/cmake/spdlogConfig.cmake.in") set(project_config_out "${CMAKE_CURRENT_BINARY_DIR}/spdlogConfig.cmake") set(config_targets_file "spdlogConfigTargets.cmake") @@ -363,7 +360,7 @@ if(SPDLOG_INSTALL) set(export_dest_dir "${CMAKE_INSTALL_LIBDIR}/cmake/spdlog") set(pkgconfig_install_dir "${CMAKE_INSTALL_LIBDIR}/pkgconfig") set(pkg_config "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc") - endif() # XP_NAMESPACE + endif() # --------------------------------------------------------------------------------------- # Include files @@ -384,7 +381,7 @@ if(SPDLOG_INSTALL) # --------------------------------------------------------------------------------------- # Install pkg-config file # --------------------------------------------------------------------------------------- - if(NOT DEFINED XP_NAMESPACE) + if(NOT COMMAND xpExternPackage) if(IS_ABSOLUTE "${CMAKE_INSTALL_INCLUDEDIR}") set(PKG_CONFIG_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}") else() @@ -400,27 +397,27 @@ if(SPDLOG_INSTALL) string(CONCAT PKG_CONFIG_DEFINES "-D" "${PKG_CONFIG_DEFINES}") configure_file("cmake/${PROJECT_NAME}.pc.in" "${pkg_config}" @ONLY) install(FILES "${pkg_config}" DESTINATION "${pkgconfig_install_dir}") - endif() # XP_NAMESPACE + endif() # --------------------------------------------------------------------------------------- # Install CMake config files # --------------------------------------------------------------------------------------- - export(TARGETS spdlog spdlog_header_only NAMESPACE ${CMAKE_NAMESPACE}:: + export(TARGETS spdlog spdlog_header_only NAMESPACE spdlog:: FILE "${CMAKE_CURRENT_BINARY_DIR}/${config_targets_file}") - install(EXPORT spdlog DESTINATION ${export_dest_dir} NAMESPACE ${CMAKE_NAMESPACE}:: FILE ${config_targets_file}) + install(EXPORT spdlog DESTINATION ${export_dest_dir} NAMESPACE spdlog:: FILE ${config_targets_file}) - if(NOT DEFINED XP_NAMESPACE) + if(NOT COMMAND xpExternPackage) include(CMakePackageConfigHelpers) configure_package_config_file("${project_config_in}" "${project_config_out}" INSTALL_DESTINATION ${export_dest_dir}) write_basic_package_version_file("${version_config_file}" COMPATIBILITY SameMajorVersion) install(FILES "${project_config_out}" "${version_config_file}" DESTINATION "${export_dest_dir}") - endif() # XP_NAMESPACE + endif() # --------------------------------------------------------------------------------------- # Support creation of installable packages # --------------------------------------------------------------------------------------- - if(NOT DEFINED XP_NAMESPACE) + if(NOT COMMAND xpExternPackage) include(cmake/spdlogCPack.cmake) - endif() # XP_NAMESPACE + endif() endif() diff --git a/CMakePresetsBase.json b/CMakePresetsBase.json index 0785535a42..5a4198137f 100644 --- a/CMakePresetsBase.json +++ b/CMakePresetsBase.json @@ -6,8 +6,7 @@ "hidden": true, "binaryDir": "${sourceDir}/_bld-${presetName}", "cacheVariables": { - "SPDLOG_FMT_EXTERNAL": "ON", - "XP_NAMESPACE": "xpro" + "SPDLOG_FMT_EXTERNAL": "ON" } } ],