Skip to content

Commit

Permalink
cmake 3.8 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
nunoplopes committed Dec 9, 2018
1 parent 82a3d33 commit 6bd5e22
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmake/FindZ3.cmake
Expand Up @@ -6,13 +6,14 @@ message(STATUS "Z3: ${Z3_INCLUDE_DIR} ${Z3_LIBRARIES}")
if (Z3_INCLUDE_DIR AND EXISTS "${Z3_INCLUDE_DIR}/z3_version.h")
file(STRINGS "${Z3_INCLUDE_DIR}/z3_version.h" Z3_VERSION_STRS
REGEX "^#define Z3_(MAJOR|MINOR|BUILD)_(VERSION|NUMBER)[ \t]+[0-9]+$")
set(Z3_INSTALLED_VERSION "")
foreach(VLINE ${Z3_VERSION_STRS})
if (VLINE MATCHES "Z3_[A-Z_ \t]+([0-9]+)")
list(APPEND Z3_INSTALLED_VERSION "${CMAKE_MATCH_1}")
set(Z3_INSTALLED_VERSION "${Z3_INSTALLED_VERSION}.${CMAKE_MATCH_1}")
endif()
endforeach()
unset(Z3_VERSION_STRS)
string(JOIN "." Z3_INSTALLED_VERSION ${Z3_INSTALLED_VERSION})
string(REGEX REPLACE "^\.(.+)" "\\1" Z3_INSTALLED_VERSION ${Z3_INSTALLED_VERSION})
else()
set(Z3_INSTALLED_VERSION "0.0.0")
endif()
Expand Down

0 comments on commit 6bd5e22

Please sign in to comment.