diff options
author | Mathias Preiner <mathias.preiner@gmail.com> | 2018-09-22 02:02:01 -0700 |
---|---|---|
committer | Mathias Preiner <mathias.preiner@gmail.com> | 2018-09-22 16:30:59 -0700 |
commit | f16ee492e0a4cff5b83649f72a54af49054a2b37 (patch) | |
tree | 862b25ef6dc76510e479b8aced9f6096e1f6411f | |
parent | eada65a37e18bea23e3cbf584f47f72859cc69f9 (diff) |
cmake: Add python3 option.
-rw-r--r-- | CMakeLists.txt | 5 | ||||
-rwxr-xr-x | configure.sh | 9 | ||||
-rw-r--r-- | src/bindings/python/CMakeLists.txt | 2 |
3 files changed, 13 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ad6adf2e0..b097a70d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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("") diff --git a/configure.sh b/configure.sh index f3ba57c82..b92c48ad4 100755 --- a/configure.sh +++ b/configure.sh @@ -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 ] \ diff --git a/src/bindings/python/CMakeLists.txt b/src/bindings/python/CMakeLists.txt index 44d64fb29..d03924680 100644 --- a/src/bindings/python/CMakeLists.txt +++ b/src/bindings/python/CMakeLists.txt @@ -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 |