diff options
author | Brad King <brad.king@kitware.com> | 2016-06-03 17:27:34 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-06-03 17:27:34 (GMT) |
commit | 236b7cbe6ef6c53b17fa240ea599f7b65e0b705f (patch) | |
tree | 18dc292f3013241a90598ba13912bafd817d208a | |
parent | 9703b32c1c75b0b343bb5043030a08a1b1345a20 (diff) | |
parent | 38d18bab54cd9dceba5902dcb4407ecdb585953c (diff) | |
download | CMake-236b7cbe6ef6c53b17fa240ea599f7b65e0b705f.zip CMake-236b7cbe6ef6c53b17fa240ea599f7b65e0b705f.tar.gz CMake-236b7cbe6ef6c53b17fa240ea599f7b65e0b705f.tar.bz2 |
Merge branch 'FindLibArchive-3.2' into release
-rw-r--r-- | Modules/FindLibArchive.cmake | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Modules/FindLibArchive.cmake b/Modules/FindLibArchive.cmake index 471a4f1..dd93041 100644 --- a/Modules/FindLibArchive.cmake +++ b/Modules/FindLibArchive.cmake @@ -42,14 +42,15 @@ mark_as_advanced(LibArchive_INCLUDE_DIR LibArchive_LIBRARY) # Extract the version number from the header. if(LibArchive_INCLUDE_DIR AND EXISTS "${LibArchive_INCLUDE_DIR}/archive.h") - # The version string appears in one of two known formats in the header: + # The version string appears in one of three known formats in the header: # #define ARCHIVE_LIBRARY_VERSION "libarchive 2.4.12" # #define ARCHIVE_VERSION_STRING "libarchive 2.8.4" - # Match either format. - set(_LibArchive_VERSION_REGEX "^#define[ \t]+ARCHIVE[_A-Z]+VERSION[_A-Z]*[ \t]+\"libarchive +([0-9]+)\\.([0-9]+)\\.([0-9]+)[^\"]*\".*$") + # #define ARCHIVE_VERSION_ONLY_STRING "3.2.0" + # Match any format. + set(_LibArchive_VERSION_REGEX "^#define[ \t]+ARCHIVE[_A-Z]+VERSION[_A-Z]*[ \t]+\"(libarchive +)?([0-9]+)\\.([0-9]+)\\.([0-9]+)[^\"]*\".*$") file(STRINGS "${LibArchive_INCLUDE_DIR}/archive.h" _LibArchive_VERSION_STRING LIMIT_COUNT 1 REGEX "${_LibArchive_VERSION_REGEX}") if(_LibArchive_VERSION_STRING) - string(REGEX REPLACE "${_LibArchive_VERSION_REGEX}" "\\1.\\2.\\3" LibArchive_VERSION "${_LibArchive_VERSION_STRING}") + string(REGEX REPLACE "${_LibArchive_VERSION_REGEX}" "\\2.\\3.\\4" LibArchive_VERSION "${_LibArchive_VERSION_STRING}") endif() unset(_LibArchive_VERSION_REGEX) unset(_LibArchive_VERSION_STRING) |