Add version macros header
This commit is contained in:
parent
27bbe75bd3
commit
43b0ed1b21
@ -161,6 +161,11 @@ target_compile_options(
|
||||
${warning_options}
|
||||
)
|
||||
|
||||
set(CPPTRACE_VERSION_MAJOR ${CMAKE_PROJECT_VERSION_MAJOR})
|
||||
set(CPPTRACE_VERSION_MINOR ${CMAKE_PROJECT_VERSION_MINOR})
|
||||
set(CPPTRACE_VERSION_PATCH ${CMAKE_PROJECT_VERSION_PATCH})
|
||||
configure_file("${PROJECT_SOURCE_DIR}/cmake/in/version-hpp.in" "${PROJECT_BINARY_DIR}/include/cpptrace/version.hpp")
|
||||
|
||||
# ---- Generate Build Info Headers ----
|
||||
|
||||
if(build_type STREQUAL "STATIC")
|
||||
|
||||
@ -787,8 +787,10 @@ Cpptrace provides a handful of headers to make inclusion more minimal.
|
||||
| `cpptrace/from_current.hpp` | [Traces From All Exceptions](#traces-from-all-exceptions) |
|
||||
| `cpptrace/io.hpp` | `operator<<` overloads for `std::ostream` and `std::formatter`s |
|
||||
| `cpptrace/utils.hpp` | Utility functions, configuration functions, and terminate utilities ([Utilities](#utilities), [Configuration](#configuration), and [Terminate Handling](#terminate-handling)) |
|
||||
| `cpptrace/version.hpp` | Library version macros |
|
||||
|
||||
The main cpptrace header is `cpptrace/cpptrace.hpp` which includes everything other than `from_current.hpp`.
|
||||
The main cpptrace header is `cpptrace/cpptrace.hpp` which includes everything other than `from_current.hpp` and
|
||||
`version.hpp`.
|
||||
|
||||
# Supported Debug Formats
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ include(CMakePackageConfigHelpers)
|
||||
install(
|
||||
DIRECTORY
|
||||
"${PROJECT_SOURCE_DIR}/include/" # our header files
|
||||
"${PROJECT_BINARY_DIR}/include/" # generated header files
|
||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
|
||||
COMPONENT ${package_name}-development
|
||||
# PATTERN "**/third_party" EXCLUDE # skip third party directory
|
||||
|
||||
11
cmake/in/version-hpp.in
Normal file
11
cmake/in/version-hpp.in
Normal file
@ -0,0 +1,11 @@
|
||||
#ifndef CPPTRACE_VERSION_HPP
|
||||
#define CPPTRACE_VERSION_HPP
|
||||
|
||||
#define CPPTRACE_VERSION_MAJOR @CPPTRACE_VERSION_MAJOR@
|
||||
#define CPPTRACE_VERSION_MINOR @CPPTRACE_VERSION_MINOR@
|
||||
#define CPPTRACE_VERSION_PATCH @CPPTRACE_VERSION_PATCH@
|
||||
|
||||
#define CPPTRACE_TO_VERSION(MAJOR, MINOR, PATCH) ((MAJOR) * 10000 + (MINOR) * 100 + (PATCH))
|
||||
#define CPPTRACE_VERSION CPPTRACE_TO_VERSION(CPPTRACE_VERSION_MAJOR, CPPTRACE_VERSION_MINOR, CPPTRACE_VERSION_PATCH)
|
||||
|
||||
#endif
|
||||
@ -1,4 +1,5 @@
|
||||
#include <cpptrace/cpptrace.hpp>
|
||||
#include <cpptrace/version.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user