Skip to content
Snippets Groups Projects
Commit 951310a4 authored by Martin Christoph Hierholzer's avatar Martin Christoph Hierholzer
Browse files

Merge project-template (automated)

parents 9b69d6fa e906920d
No related branches found
Tags 08.00.01
1 merge request!6feat(project-template): add VersionInfo.h generation (#40)
......@@ -35,3 +35,12 @@ endif( ${PROJECT_NAME}_BUILDVERSION )
set(${PROJECT_NAME}_FULL_LIBRARY_VERSION ${${PROJECT_NAME}_SOVERSION}.${${PROJECT_NAME}_PATCH_VERSION})
# The following generates a cpp header file that can be used to access the CMAKE version info.
# The "VersionInfo.h" is available in the project's build directory and included in the build.
string(REGEX REPLACE "^0" "" ${PROJECT_NAME}_MAJOR_VERSION_INT ${${PROJECT_NAME}_MAJOR_VERSION})
string(REGEX REPLACE "^0" "" ${PROJECT_NAME}_MINOR_VERSION_INT ${${PROJECT_NAME}_MINOR_VERSION})
string(REGEX REPLACE "^0" "" ${PROJECT_NAME}_PATCH_VERSION_INT ${${PROJECT_NAME}_PATCH_VERSION})
configure_file(cmake/version_info_template.h.in "${PROJECT_BINARY_DIR}/generated/VersionInfo.h")
include_directories(${PROJECT_BINARY_DIR}/generated)
#pragma once
namespace ChimeraTK::VersionInfo {
const int major{${${PROJECT_NAME}_MAJOR_VERSION_INT}};
const int minor{${${PROJECT_NAME}_MINOR_VERSION_INT}};
const int applicationPatch{${${PROJECT_NAME}_PATCH_VERSION_INT}};
} // namespace ChimeraTK::VersionInfo
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment