mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-30 10:47:35 +02:00
CMake imported targets should be namespaced
This commit is contained in:
committed by
Victor Zverovich
parent
e14bac62a0
commit
048d2aec27
@ -77,14 +77,15 @@ if (FMT_INSTALL)
|
|||||||
${PROJECT_SOURCE_DIR}/support/cmake/fmt-config.cmake.in
|
${PROJECT_SOURCE_DIR}/support/cmake/fmt-config.cmake.in
|
||||||
${project_config}
|
${project_config}
|
||||||
INSTALL_DESTINATION ${FMT_CMAKE_DIR})
|
INSTALL_DESTINATION ${FMT_CMAKE_DIR})
|
||||||
export(TARGETS ${INSTALL_TARGETS}
|
export(TARGETS ${INSTALL_TARGETS} NAMESPACE fmt::
|
||||||
FILE ${PROJECT_BINARY_DIR}/${targets_export_name}.cmake)
|
FILE ${PROJECT_BINARY_DIR}/${targets_export_name}.cmake)
|
||||||
|
|
||||||
# Install version, config and target files.
|
# Install version, config and target files.
|
||||||
install(
|
install(
|
||||||
FILES ${project_config} ${version_config}
|
FILES ${project_config} ${version_config}
|
||||||
DESTINATION ${FMT_CMAKE_DIR})
|
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 the library and headers.
|
||||||
install(TARGETS ${INSTALL_TARGETS} EXPORT ${targets_export_name}
|
install(TARGETS ${INSTALL_TARGETS} EXPORT ${targets_export_name}
|
||||||
|
@ -5,7 +5,7 @@ project(fmt-test)
|
|||||||
find_package(FMT REQUIRED)
|
find_package(FMT REQUIRED)
|
||||||
|
|
||||||
add_executable(library-test main.cc)
|
add_executable(library-test main.cc)
|
||||||
target_link_libraries(library-test fmt)
|
target_link_libraries(library-test fmt::fmt)
|
||||||
|
|
||||||
if (TARGET fmt-header-only)
|
if (TARGET fmt-header-only)
|
||||||
add_executable(header-only-test main.cc)
|
add_executable(header-only-test main.cc)
|
||||||
|
Reference in New Issue
Block a user