- 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>
* 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>
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.
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.
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.