Skip to content

Commit

Permalink
Fixed Python detection under different versions of CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelwa committed Dec 4, 2019
1 parent 1d86928 commit bc3116e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ set(Z3_DIR ${CMAKE_BINARY_DIR}/z3)

if (UNIX)
# Require Python interpreter
find_package(Python COMPONENTS Interpreter)
if (${CMAKE_VERSION} VERSION_LESS "3.12.0")
find_package(PythonInterp) # deprecated since CMake 3.12, but works far better
else ()
find_package(Python COMPONENTS Interpreter)
endif ()
# Add option to compile Z3 with verbose output
option(BUILD_Z3_VERBOSE "Output status and warnings during Z3 build" OFF)
# Use /dev/null to silence Z3. Not elegant but efficient
Expand All @@ -67,7 +71,7 @@ if (UNIX)
set(Z3_LIB_FLAG --staticlib)
set(Z3_LINK_TARGET libz3.a)
else ()
set(Z3_LINK_TARGET libz3.so)
set(Z3_LINK_TARGET libz3.so)
endif ()

# include and library paths
Expand Down

0 comments on commit bc3116e

Please sign in to comment.