mirror of
https://github.com/fmtlib/fmt.git
synced 2026-07-30 16:26:27 +08:00
export() was scoped inside if (FMT_INSTALL), so projects that pull in fmt via add_subdirectory()/FetchContent without installing it had no way to get the exported fmt::* targets. If such a project tries to export its own targets that depend on fmt, CMake fails with "target ... requires target fmt that is not in any export set". Hoist the target list/export name and the export() call itself out of the FMT_INSTALL guard so the build-tree export file is always generated; the install()-only pieces (config/version files, pkgconfig, install(EXPORT ...)) stay behind the guard and installed behavior is unchanged. Fixes #4806 Co-authored-by: flink <w741069229@gmail.com>
4 lines
90 B
C++
4 lines
90 B
C++
#include "fmt/base.h"
|
|
|
|
void greet(const char* name) { fmt::print("Hello, {}!\n", name); }
|