diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a3f5d632710257716b95aaa618d17c0f6312292..be7356b9b6ba9d90b091ed2ace45303555ff0a52 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,9 +8,13 @@ PROJECT(Nektar++) # Helps organize projects in IDEs. SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON) -SET(NEKTAR_VERSION_MAJOR 3) -SET(NEKTAR_VERSION_MINOR 2) -SET(NEKTAR_VERSION_PATCH 0) +# Extract the version number from the VERSION file and set in CMake +# The format of this file must be X.X.X +FILE(STRINGS "VERSION" NEKVER) +STRING(REPLACE "." ";" NEKVERLIST ${NEKVER}) +LIST(GET NEKVERLIST 0 NEKTAR_VERSION_MAJOR) +LIST(GET NEKVERLIST 1 NEKTAR_VERSION_MINOR) +LIST(GET NEKVERLIST 2 NEKTAR_VERSION_PATCH) SET(NEKTAR_VERSION ${NEKTAR_VERSION_MAJOR}.${NEKTAR_VERSION_MINOR}.${NEKTAR_VERSION_PATCH}) INCLUDE(CMakeExportBuildSettings)