diff options
author | David Cole <david.cole@kitware.com> | 2012-08-20 19:42:34 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2012-08-20 19:42:34 (GMT) |
commit | c79dd4d951eec397692dd4af18e6a85b25a4f4ef (patch) | |
tree | 8e7cbfd9c44e410b216b18fecf331c8d50cfa922 /Modules/FindArmadillo.cmake | |
parent | 19e210af90d943548e7f07759030a2dd2cc8a2a4 (diff) | |
parent | 4be6783711b2ff510c3449c5de22d35663d8bfc1 (diff) | |
download | CMake-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.cmake | 3 |
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}") |