summaryrefslogtreecommitdiffstats
path: root/Modules/FindArmadillo.cmake
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2012-08-20 19:42:34 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2012-08-20 19:42:34 (GMT)
commitc79dd4d951eec397692dd4af18e6a85b25a4f4ef (patch)
tree8e7cbfd9c44e410b216b18fecf331c8d50cfa922 /Modules/FindArmadillo.cmake
parent19e210af90d943548e7f07759030a2dd2cc8a2a4 (diff)
parent4be6783711b2ff510c3449c5de22d35663d8bfc1 (diff)
downloadCMake-c79dd4d951eec397692dd4af18e6a85b25a4f4ef.zip
CMake-c79dd4d951eec397692dd4af18e6a85b25a4f4ef.tar.gz
CMake-c79dd4d951eec397692dd4af18e6a85b25a4f4ef.tar.bz2
Merge topic 'read-less-from-version-headers'
4be6783 read less from version headers into variables
Diffstat (limited to 'Modules/FindArmadillo.cmake')
-rw-r--r--Modules/FindArmadillo.cmake3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/FindArmadillo.cmake b/Modules/FindArmadillo.cmake
index ebbdb0a..bc0357e 100644
--- a/Modules/FindArmadillo.cmake
+++ b/Modules/FindArmadillo.cmake
@@ -58,7 +58,7 @@ if(ARMADILLO_INCLUDE_DIR)
if(EXISTS "${ARMADILLO_INCLUDE_DIR}/armadillo_bits/arma_version.hpp")
# Read and parse armdillo version header file for version number
- file(READ "${ARMADILLO_INCLUDE_DIR}/armadillo_bits/arma_version.hpp" _armadillo_HEADER_CONTENTS)
+ file(STRINGS "${ARMADILLO_INCLUDE_DIR}/armadillo_bits/arma_version.hpp" _armadillo_HEADER_CONTENTS REGEX "#define ARMA_VERSION_[A-Z]+ ")
string(REGEX REPLACE ".*#define ARMA_VERSION_MAJOR ([0-9]+).*" "\\1" ARMADILLO_VERSION_MAJOR "${_armadillo_HEADER_CONTENTS}")
string(REGEX REPLACE ".*#define ARMA_VERSION_MINOR ([0-9]+).*" "\\1" ARMADILLO_VERSION_MINOR "${_armadillo_HEADER_CONTENTS}")
string(REGEX REPLACE ".*#define ARMA_VERSION_PATCH ([0-9]+).*" "\\1" ARMADILLO_VERSION_PATCH "${_armadillo_HEADER_CONTENTS}")
@@ -66,6 +66,7 @@ if(ARMADILLO_INCLUDE_DIR)
# WARNING: The number of spaces before the version name is not one.
string(REGEX REPLACE ".*#define ARMA_VERSION_NAME +\"([0-9a-zA-Z _-]+)\".*" "\\1" ARMADILLO_VERSION_NAME "${_armadillo_HEADER_CONTENTS}")
+ unset(_armadillo_HEADER_CONTENTS)
endif()
set(ARMADILLO_VERSION_STRING "${ARMADILLO_VERSION_MAJOR}.${ARMADILLO_VERSION_MINOR}.${ARMADILLO_VERSION_PATCH}")