362 Commits

Author SHA1 Message Date
Victor Zverovich
879463ecad Apply cmake-format 2026-03-14 14:24:09 -07:00
Victor Chernyakin
245e4d9723
Clean up a couple of CMake includes (#4710)
CMakeParseArguments is a no-op since CMake 3.5 and the
minimum version {fmt} supports is 3.8:
    https://cmake.org/cmake/help/latest/module/CMakeParseArguments.html

GNUInstallDirs is already unconditionally included
earlier in the file.
2026-03-11 06:32:04 -07:00
Mathew Benson
2b4eb7df47
Update Check for module support to include compiler versions (#4709)
- We need to confirm compiler support for module scanning before
  creating the CXX_MODULE FILE_SET using the `target_sources` command
- This is especially relevant for compilers that have module support but
  do not support the module scanning such as g++13, clang15. For these
    we can use the older way of creating the fmt-module target

Co-authored-by: Mathew Benson <mathew@benson.co.ke>
2026-03-09 15:37:46 -07:00
Ferdinand Bachmann
e2bf61cdf8
Fix fmt-c.h not being installed with fmt-c library (#4694)
Signed-off-by: Ferdinand Bachmann <ferdinand.bachmann@yrlf.at>
2026-03-03 16:43:53 -08:00
Victor Zverovich
e090e3ffad Apply cmake-format 2026-03-03 15:49:40 -08:00
Victor Zverovich
011b24123b Cleanup module test 2026-03-03 12:30:54 -08:00
Victor Zverovich
43d4810ba9 Cleanup CMake config more 2026-03-03 11:40:10 -08:00
Victor Zverovich
e3a149f23c Cleanup CMake config 2026-03-03 09:51:56 -08:00
Mathew Benson
4e1b170b44
Add Separate CMake Target for C++20 Modules (#4685)
* Add Separate CMake Target for C++20 Modules

In the same vein as there is the `fmt::fmt-header-only`, `fmt::fmt` and
`fmt::fmt_c` targets, I propose the addition of a new target
`fmt::fmt-module` which will be for the compilation of the FMT_MODULE
library option.

The new target will have the properties requried for Compiling,
Installing and using the C++20 functionality in CMake

The `add_module_library` function is marked as deprecated as its
functionality is superseded.

Updated the logic for setting the FMT_USE_CMAKE_MODULE flag to check the
versions for Ninja and MSVC according the CMAKE Documents and setting
the FMT_MODULE flag based on this

* Add Separate CMake Target for C++20 Modules

In the same vein as there is the `fmt::fmt-header-only`, `fmt::fmt` and
`fmt::fmt_c` targets, I propose the addition of a new target
`fmt::fmt-module` which will be for the compilation of the FMT_MODULE
library option.

The new target will have the properties requried for Compiling,
Installing and using the C++20 functionality in CMake

Updated the logic for setting the FMT_USE_CMAKE_MODULE flag to check the
versions for Ninja and MSVC according the CMAKE Documents and setting
the FMT_MODULE flag based on this

Fixed the test/CMakeLists.txt file which used the FMT_MODULE flag to
separate the module and non-module library testing, in particular
disableing the module version.

The module testing still needs to be fixed, but the expected behavior of
testing the non-modular version is working.

---------

Co-authored-by: Mathew Benson <mathew@benson.co.ke>
Co-authored-by: ClausKlein <claus.klein@arcormail.de>
2026-03-02 09:11:31 -08:00
Victor Zverovich
dc97113ca1 Cleanup the C API 2026-02-21 17:15:19 -08:00
Soumik15630m
1dc644e021
Add C11 API with type-safe formatting (#4663) (#4671) 2026-02-16 07:06:32 -08:00
torsten48
f99d530247
Add include_guard (GLOBAL) to allow usage in multiple submodules (#4672) 2026-02-08 10:36:43 -08:00
crueter
da97ba2914
[cmake] fix MASTER_PROJECT heuristic; only enable install if master project (#4536)
SOURCE vs CURRENT_SOURCE is unreliable. `DEFINED PROJECT_NAME` is a much more portable way of determination.

Also, installation shouldn't default to on if it is a subproject.
2025-09-10 11:01:25 -07:00
autoantwort
a0ecfe3e1c
msvc + ninja + modules: Fix build when consuming fmtlib while using a Ninja generator (#4495)
Co-authored-by: Leander Schulten <Leander.Schulten@tetys.de>
2025-07-13 10:28:00 -07:00
n-stein
55a8f6a4be
Change component prefix for NSIS compatibility (#4442) 2025-05-09 12:09:18 -07:00
rlalik
2d0518b5f7
Fix cmake error in pedantic mode (#4426)
Suppresses error:
CMake Error (dev) at build/coverage/_deps/fmt-src/CMakeLists.txt:208 (set):
  uninitialized variable 'CMAKE_MODULE_PATH'
This error is for project developers. Use -Wno-error=dev to suppress it.
2025-04-24 11:41:33 -07:00
Thomas Khyn
ed27df5760
Replace forward slashes by backslashes in BMI path for MSVC. (#4344)
* Fix slashes in BMI path for MSVC builds
* Fix BMI path for MSVC builds when building with Ninja generator
2025-02-10 00:18:33 -08:00
Rafał Lalik
01a5b56f0d Fix error of unitialized variable FMT_HEADERS
This happens when using e.g. pedantic mode in cmake-init.
2025-01-25 08:41:49 -08:00
Victor Zverovich
c43da35701 Workaround an ICE when using modules with gcc 14.2 and earlier 2025-01-12 08:57:43 -08:00
Victor Zverovich
d57040f949 Prefix components 2025-01-10 19:51:55 -08:00
Carl Smedstad
5fa4bdd758
Define CMake components to allow docs to be installed separately (#4276)
Define two components, core and doc, which can be installed separately.
This facilitates packagers who want to package docs in a separate
package.

After this change it's possible to install only core files with:

     cmake --install build --component core

And only install documentation with:

     cmake --install build --component doc

When no component is specified, the behaviour is unchanged, i.e. if
documentation was built, it will be installed.
2024-12-26 07:13:01 -08:00
Amin Yahyaabadi
f924d16e47 fix: pass /utf-8 only if the compiler is MSVC at build time 2024-09-11 08:21:07 -07:00
Vladislav Shchapov
6870e4b06b Workaround for GCC regression: false positive null-dereference in vector.resize
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2024-09-05 09:40:55 -07:00
cdzhan
fb07b37c5b
Prioritize using the header files of self (#4116) 2024-08-13 10:50:49 -07:00
Victor Zverovich
e50c8b6bd8 Fix disabling Unicode support 2024-07-04 07:27:22 -07:00
Victor Zverovich
6f68c62cb5 Ignore doxygen files 2024-06-30 08:42:34 -07:00
Victor Zverovich
d059fe42a8 Ignore vagrant files 2024-06-30 08:33:37 -07:00
Victor Zverovich
43c5b34749 Fix package build 2024-06-30 08:23:25 -07:00
Victor Zverovich
0fae326c42 Update site dir 2024-06-29 08:32:24 -07:00
Victor Zverovich
8b1fcf5cc1 Update doc dir 2024-06-29 08:18:24 -07:00
Victor Zverovich
98dd673cf8 Cleanup cmake 2024-06-14 08:04:11 -07:00
LoveSy
c4ea903250
Only install FILE_SET when needed (#4013) 2024-06-13 12:17:46 -07:00
ChristianGebhardt
077e4ae746
Added generator expression to /utf-8 compile option (#3995)
Do not pass the compile options in the project to other compilers such as nvcc
2024-06-09 13:05:17 -07:00
Victor Zverovich
b5c8fd783c Fix doc build 2024-06-09 11:37:18 -07:00
Victor Zverovich
e6d4f927cc Improve docs 2024-06-09 11:17:32 -07:00
Victor Zverovich
8de3e87da1 Add a CMake option to control Unicode support 2024-06-09 11:16:13 -07:00
LoveSy
46d2acb3ba
Don't add os.cc to sources with FMT_MODULE (#4004)
It will be included by `fmt.cc`
2024-06-09 11:00:12 -07:00
LoveSy
0f6e716548
Fix missing includes in fmt.cc (#3994)
This causes duplicated std definitions in the fmt module
2024-06-08 13:50:29 -07:00
Victor Zverovich
21372bc0b2 Update cmake config 2024-06-08 08:21:18 -07:00
LoveSy
fcc0b49978
Fix FMT_INSTALL with FMT_MODULE (#3998) 2024-06-08 07:26:53 -07:00
LoveSy
0560c334fb
Fix build with FMT_MODULE=OFF (#3997) 2024-06-07 06:25:07 -07:00
LoveSy
5c445bc42c Reverting check to make shorter branch comes first 2024-06-05 21:01:42 -07:00
LoveSy
6abc1204f3 Check if the generator is ninja 2024-06-05 21:01:42 -07:00
LoveSy
a9b8517638 Use native c++ module support from CMake
also fix some clang compilation issues when using c++ modules
2024-06-05 21:01:42 -07:00
Victor Zverovich
dab1a65d2c Sort out directory URI config 2024-06-02 09:47:52 -07:00
Victor Zverovich
871538d3ab Fix install dir 2024-06-02 09:05:32 -07:00
Victor Zverovich
250456d5a3 Migrate to mkdocs 2024-06-02 09:00:40 -07:00
Victor Zverovich
b7809f91e2 Enable Unicode support by default 2024-05-11 15:11:23 -07:00
Damian Andrei
3b5f3de3b5
Make CMake version message less confusing (#3907) 2024-03-28 18:23:26 -07:00
Victor Zverovich
7a63e233d2 Readd core.h to headers 2024-02-10 07:10:28 -08:00