From b9b5f41e04dc535d52da767ce3cb3b00d4fffe21 Mon Sep 17 00:00:00 2001 From: Bjoern Thiel Date: Fri, 19 May 2017 09:52:27 +0200 Subject: [PATCH 1/3] CMake imported targets should be namespaced --- fmt/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fmt/CMakeLists.txt b/fmt/CMakeLists.txt index 29e881b37c12..2b50e1dba72d 100644 --- a/fmt/CMakeLists.txt +++ b/fmt/CMakeLists.txt @@ -84,7 +84,8 @@ if (FMT_INSTALL) install( FILES ${project_config} ${version_config} DESTINATION ${FMT_CMAKE_DIR}) - install(EXPORT ${targets_export_name} DESTINATION ${FMT_CMAKE_DIR}) + install(EXPORT ${targets_export_name} DESTINATION ${FMT_CMAKE_DIR} + NAMESPACE Fmt::) # Install the library and headers. install(TARGETS ${INSTALL_TARGETS} EXPORT ${targets_export_name} From 1950ca27f291d8da214aa219868047aa4758f12d Mon Sep 17 00:00:00 2001 From: Bjoern Thiel Date: Fri, 19 May 2017 11:23:12 +0200 Subject: [PATCH 2/3] addendum --- fmt/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fmt/CMakeLists.txt b/fmt/CMakeLists.txt index 2b50e1dba72d..295afa5d1dd1 100644 --- a/fmt/CMakeLists.txt +++ b/fmt/CMakeLists.txt @@ -77,7 +77,7 @@ if (FMT_INSTALL) ${PROJECT_SOURCE_DIR}/support/cmake/fmt-config.cmake.in ${project_config} INSTALL_DESTINATION ${FMT_CMAKE_DIR}) - export(TARGETS ${INSTALL_TARGETS} + export(TARGETS ${INSTALL_TARGETS} NAMESPACE Fmt:: FILE ${PROJECT_BINARY_DIR}/${targets_export_name}.cmake) # Install version, config and target files. From 98b875ac1f526140e3f8ac076d25da6a9a25e5f8 Mon Sep 17 00:00:00 2001 From: Bjoern Thiel Date: Fri, 19 May 2017 11:31:12 +0200 Subject: [PATCH 3/3] find package test adjusted --- test/find-package-test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/find-package-test/CMakeLists.txt b/test/find-package-test/CMakeLists.txt index 1f28c30c6c50..252df725fc39 100644 --- a/test/find-package-test/CMakeLists.txt +++ b/test/find-package-test/CMakeLists.txt @@ -5,7 +5,7 @@ project(fmt-test) find_package(FMT REQUIRED) add_executable(library-test main.cc) -target_link_libraries(library-test fmt) +target_link_libraries(library-test Fmt::fmt) if (TARGET fmt-header-only) add_executable(header-only-test main.cc)