diff options
author | Andy Clayton <q3aiml@gmail.com> | 2020-05-17 15:13:17 -0500 |
---|---|---|
committer | Martin Michlmayr <tbm@cyrius.com> | 2020-05-18 12:28:29 +0800 |
commit | 54d6128e2a7792726d6080e415636186117be363 (patch) | |
tree | 2b1e1188384297623b67068ddddf75c18c10b331 /CMakeLists.txt | |
parent | 9551b0f73e40b3d9a2f64134fd37c1784b34f063 (diff) | |
download | fork-ledger-54d6128e2a7792726d6080e415636186117be363.tar.gz fork-ledger-54d6128e2a7792726d6080e415636186117be363.tar.bz2 fork-ledger-54d6128e2a7792726d6080e415636186117be363.zip |
use system FindPython if newer
Avoid needing to keep our copy updated and only keep it as a fallback
for when system cmake is not new enough.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index aa5342ee..73bdec05 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,10 @@ set(Ledger_TEST_TIMEZONE "America/Chicago") # Point CMake at any custom modules we may ship list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") +if(${CMAKE_VERSION} VERSION_LESS "3.16.0") + # use backported module from 3.15 (introduced 3.12) to support older versions of cmake + list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/python-backport") +endif() enable_testing() @@ -65,7 +69,7 @@ if (USE_PYTHON) if (PYTHON_FOUND) set(BOOST_PYTHON "python${Python_VERSION_MAJOR}${Python_VERSION_MINOR}") set(HAVE_BOOST_PYTHON 1) - include_directories(SYSTEM ${Python_INCLUDE_DIR}) + include_directories(SYSTEM ${Python_INCLUDE_DIRS}) else() set(HAVE_BOOST_PYTHON 0) message("Could not find a Python library to use with Boost.Python") @@ -163,7 +167,7 @@ if (HAVE_BOOST_PYTHON) cmake_push_check_state() set(CMAKE_REQUIRED_INCLUDES - ${CMAKE_INCLUDE_PATH} ${Boost_INCLUDE_DIRS} ${Python_INCLUDE_DIR}) + ${CMAKE_INCLUDE_PATH} ${Boost_INCLUDE_DIRS} ${Python_INCLUDE_DIRS}) set(CMAKE_REQUIRED_LIBRARIES ${Boost_LIBRARIES} ${Python_LIBRARIES} ${PROFILE_LIBS}) |