mirror of
https://github.com/fmtlib/fmt.git
synced 2026-08-03 20:14:20 +02:00
Simplify build-tree export and rename INSTALL_TARGETS
Rename INSTALL_TARGETS to FMT_TARGETS since the list is now used for both installation and the build-tree export, and move INSTALL_FILE_SET into the FMT_INSTALL block as only install(TARGETS) uses it. Replace the export-test static library and export-lib.cc with an INTERFACE library, which reproduces the same CMake export dependency check (#4806).
This commit is contained in:
@@ -16,11 +16,9 @@ if (TARGET fmt::fmt-header-only)
|
||||
target_link_libraries(header-only-test fmt::fmt-header-only)
|
||||
endif ()
|
||||
|
||||
# Test that a target publicly depending on fmt can itself be exported even
|
||||
# though fmt is added via add_subdirectory and FMT_INSTALL is off (#4806).
|
||||
add_library(export-test STATIC export-lib.cc)
|
||||
target_link_libraries(export-test PUBLIC fmt::fmt)
|
||||
# Test that a target depending on fmt can itself be exported (#4806).
|
||||
add_library(export-test INTERFACE)
|
||||
target_link_libraries(export-test INTERFACE fmt::fmt)
|
||||
export(
|
||||
TARGETS export-test
|
||||
NAMESPACE test::
|
||||
FILE ${CMAKE_CURRENT_BINARY_DIR}/export-test-targets.cmake)
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
#include "fmt/base.h"
|
||||
|
||||
void greet(const char* name) { fmt::print("Hello, {}!\n", name); }
|
||||
Reference in New Issue
Block a user