diff options
| author | Markus Mittendrein <maxmitti@maxmitti.tk> | 2022-01-08 00:28:58 +0100 |
|---|---|---|
| committer | Markus Mittendrein <maxmitti@maxmitti.tk> | 2022-01-08 00:28:58 +0100 |
| commit | 54dfcc50fb6fffca6daaa0e0d70cb558e3efd3e5 (patch) | |
| tree | 2867dee31b6504c16dc7b70ea7a44d67cfb77792 /CMakeLists.txt | |
| parent | f2c30b4214a11c575e27b79928e82dda91bd03aa (diff) | |
| download | cxxformat-54dfcc50fb6fffca6daaa0e0d70cb558e3efd3e5.tar.gz cxxformat-54dfcc50fb6fffca6daaa0e0d70cb558e3efd3e5.zip | |
Add CMake target to generate a single header file
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 46720d7..89be727 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,5 +17,19 @@ add_library(cxxformat INTERFACE target_include_directories(cxxformat INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include") target_compile_features(cxxformat INTERFACE cxx_std_20) +add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/cxxformat.hpp" + COMMAND "${CMAKE_COMMAND}" "-DOUTPUT=${CMAKE_CURRENT_BINARY_DIR}/cxxformat.hpp" "-DSRC_DIR=${CMAKE_CURRENT_SOURCE_DIR}" -P "${CMAKE_CURRENT_SOURCE_DIR}/GenerateSingleHeader.cmake" + DEPENDS include/cxxformat/core.hpp + include/cxxformat/file_ptr.hpp + include/cxxformat/formatters.hpp + include/cxxformat/helpers.hpp + include/cxxformat/ostream.hpp + include/cxxformat/runtime.hpp + include/cxxformat/string.hpp + GenerateSingleHeader.cmake +) + +add_custom_target(single-header DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/cxxformat.hpp") + add_executable(test EXCLUDE_FROM_ALL main.cpp) target_link_libraries(test PRIVATE cxxformat) |
