cmake: Add python3 option.
authorMathias Preiner <mathias.preiner@gmail.com>
Sat, 22 Sep 2018 09:02:01 +0000 (02:02 -0700)
committerMathias Preiner <mathias.preiner@gmail.com>
Sat, 22 Sep 2018 23:30:59 +0000 (16:30 -0700)
CMakeLists.txt
configure.sh
src/bindings/python/CMakeLists.txt

index ad6adf2e037e18df1f0ddb99f79753886f09e3ee..b097a70d7bd59dc1d4ae1eee5d26c59af59d9610 100644 (file)
@@ -79,6 +79,7 @@ option(USE_CRYPTOMINISAT "Use CryptoMiniSat SAT solver")
 option(USE_LFSC          "Use LFSC proof checker")
 option(USE_SYMFPU        "Use SymFPU for floating point support")
 option(USE_PYTHON2       "Prefer using Python 2 (for Python bindings)")
+option(USE_PYTHON3       "Prefer using Python 3 (for Python bindings)")
 
 # Custom install directories for dependencies
 # If no directory is provided by the user, we first check if the dependency was
@@ -217,8 +218,9 @@ enable_testing()
 
 if(USE_PYTHON2)
   find_package(PythonInterp 2.7 REQUIRED)
+elseif(USE_PYTHON3)
+  find_package(PythonInterp 3 REQUIRED)
 else()
-  find_package(PythonInterp 3)
   find_package(PythonInterp REQUIRED)
 endif()
 
@@ -459,6 +461,7 @@ print_config("Shared libs          :" ENABLE_SHARED)
 print_config("Java bindings        :" BUILD_BINDINGS_JAVA)
 print_config("Python bindings      :" BUILD_BINDINGS_PYTHON)
 print_config("Python2              :" USE_PYTHON2)
+print_config("Python3              :" USE_PYTHON3)
 message("")
 print_config("Portfolio            :" ENABLE_PORTFOLIO)
 message("")
index f3ba57c828c8c14ec19eb7de20669399cbae62a8..b92c48ad47f7642d567ddba9ff8448e0418fddb8 100755 (executable)
@@ -38,7 +38,8 @@ The following flags enable optional features (disable with --no-<option name>).
   --coverage               support for gcov coverage testing
   --profiling              support for gprof profiling
   --unit-testing           support for unit testing
-  --python2                prefer using Python 2 (for Python bindings)
+  --python2                prefer using Python 2 (also for Python bindings)
+  --python3                prefer using Python 3 (also for Python bindings)
 
 The following options configure parameterized features.
 
@@ -125,6 +126,7 @@ symfpu=default
 tracing=default
 unit_testing=default
 python2=default
+python3=default
 valgrind=default
 profiling=default
 readline=default
@@ -241,6 +243,9 @@ do
     --python2) python2=ON;;
     --no-python2) python2=OFF;;
 
+    --python3) python3=ON;;
+    --no-python3) python3=OFF;;
+
     --valgrind) valgrind=ON;;
     --no-valgrind) valgrind=OFF;;
 
@@ -350,6 +355,8 @@ cmake_opts=""
   && cmake_opts="$cmake_opts -DENABLE_UNIT_TESTING=$unit_testing"
 [ $python2 != default ] \
   && cmake_opts="$cmake_opts -DUSE_PYTHON2=$python2"
+[ $python3 != default ] \
+  && cmake_opts="$cmake_opts -DUSE_PYTHON3=$python3"
 [ $valgrind != default ] \
   && cmake_opts="$cmake_opts -DENABLE_VALGRIND=$valgrind"
 [ $profiling != default ] \
index 44d64fb29cafde56a758c3a8c96e2c88457ece9d..d039246803fb187b68c9308ffaf41aab388b0146 100644 (file)
@@ -1,6 +1,6 @@
 # Make sure that interpreter and libraries have a compatible version.
 # Note: We use the Python interpreter to determine the install path for Python
-# modules.  If the interpreter and library have different version, the module
+# modules.  If the interpreter and library have different versions, the module
 # will be installed for the wrong Python version. Hence, we require the library
 # version to match the Python interpreter's version.
 find_package(PythonLibs