summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAlexis Hildebrandt <afh@surryhill.net>2022-07-04 22:30:31 +0200
committerMartin Michlmayr <tbm@cyrius.com>2023-02-01 09:31:05 +0800
commitadf9d22de4d5c422dcaeca022ea53880f7264be6 (patch)
tree48c99bde533a0118e8452bdc804dc8465469d398 /CMakeLists.txt
parentba33c732de8e272576066d7a22de5ebc01a355c9 (diff)
downloadledger-adf9d22de4d5c422dcaeca022ea53880f7264be6.tar.gz
ledger-adf9d22de4d5c422dcaeca022ea53880f7264be6.tar.bz2
ledger-adf9d22de4d5c422dcaeca022ea53880f7264be6.zip
Remove support for Python 2.x
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt11
1 files changed, 8 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 38a9c804..14618d2e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -69,9 +69,14 @@ if (USE_PYTHON)
find_package(Python COMPONENTS Interpreter Development)
if (PYTHON_FOUND)
- set(BOOST_PYTHON "python${Python_VERSION_MAJOR}${Python_VERSION_MINOR}")
- set(HAVE_BOOST_PYTHON 1)
- include_directories(SYSTEM ${Python_INCLUDE_DIRS})
+ if (${Python_VERSION_MAJOR} VERSION_GREATER_EQUAL "3")
+ set(BOOST_PYTHON "python${Python_VERSION_MAJOR}${Python_VERSION_MINOR}")
+ set(HAVE_BOOST_PYTHON 1)
+ include_directories(SYSTEM ${Python_INCLUDE_DIRS})
+ else()
+ set(HAVE_BOOST_PYTHON 0)
+ message("Ledger requires Python >= 3.x")
+ endif()
else()
set(HAVE_BOOST_PYTHON 0)
message("Could not find a Python library to use with Boost.Python")