mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 04:50:34 +05:00
install netgen_version.hpp, set version in Archive
This commit is contained in:
parent
2f88502729
commit
dcc0484be0
@ -79,6 +79,7 @@ endif()
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
include (${CMAKE_CURRENT_LIST_DIR}/cmake/generate_version_file.cmake)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/netgen_version.hpp DESTINATION ${NG_INSTALL_DIR_INCLUDE}/include COMPONENT netgen_devel)
|
||||
set(CPACK_PACKAGE_VERSION "${NETGEN_VERSION}")
|
||||
|
||||
|
||||
|
@ -36,7 +36,17 @@ endif()
|
||||
set(NETGEN_VERSION_LONG ${NETGEN_VERSION_SHORT}-${NETGEN_VERSION_TWEAK}-${NETGEN_VERSION_HASH})
|
||||
|
||||
set(version_file ${BDIR}/netgen_version.hpp)
|
||||
set(new_version_file_string "#define NETGEN_VERSION \"${NETGEN_VERSION}\"\n")
|
||||
set(new_version_file_string "\
|
||||
#ifndef NETGEN_VERSION_HPP_INCLUDED
|
||||
#define NETGEN_VERSION_HPP_INCLUDED
|
||||
#define NETGEN_VERSION \"${NETGEN_VERSION}\"
|
||||
#define NETGEN_VERSION_MAJOR ${NETGEN_VERSION_MAJOR}
|
||||
#define NETGEN_VERSION_MINOR ${NETGEN_VERSION_MINOR}
|
||||
#define NETGEN_VERSION_PATCH ${NETGEN_VERSION_PATCH}
|
||||
#define NETGEN_VERSION_TWEAK ${NETGEN_VERSION_TWEAK}
|
||||
#define NETGEN_VERSION_HASH \"${NETGEN_VERSION_HASH}\"
|
||||
#endif // NETGEN_VERSION_HPP_INCLUDED
|
||||
")
|
||||
if(EXISTS ${version_file})
|
||||
file(READ ${version_file} old_version_file_string )
|
||||
if(${old_version_file_string} STREQUAL ${new_version_file_string})
|
||||
|
@ -1,5 +1,6 @@
|
||||
|
||||
#include "archive.hpp"
|
||||
#include <netgen_version.hpp>
|
||||
|
||||
#ifndef WIN32
|
||||
#include <cxxabi.h>
|
||||
@ -44,4 +45,10 @@ namespace ngcore
|
||||
std::make_unique<std::map<std::string, detail::ClassArchiveInfo>>();
|
||||
return type_register->count(classname) != 0;
|
||||
}
|
||||
|
||||
|
||||
static bool dummy = [](){
|
||||
SetLibraryVersion("netgen", NETGEN_VERSION);
|
||||
return true;
|
||||
}();
|
||||
} // namespace ngcore
|
||||
|
Loading…
Reference in New Issue
Block a user