diff options
author | Sanel Zukan <karijes@users.sourceforge.net> | 2021-01-12 14:18:10 +0100 |
---|---|---|
committer | Martin Michlmayr <tbm@cyrius.com> | 2021-01-14 11:47:30 +0800 |
commit | 477484a817fe1f0569acc33ae7e8ee6ec9934280 (patch) | |
tree | 241ce379b22e5e3b341c48f62da1f99d63904c45 /CMakeLists.txt | |
parent | 10de5e7e506a8ce3ec36367a48acf20f2c20e626 (diff) | |
download | fork-ledger-477484a817fe1f0569acc33ae7e8ee6ec9934280.tar.gz fork-ledger-477484a817fe1f0569acc33ae7e8ee6ec9934280.tar.bz2 fork-ledger-477484a817fe1f0569acc33ae7e8ee6ec9934280.zip |
Support for building on older cmake versions
Backported python cmake module expects at least cmake 3.7 (requested
by policy), which will break builds on older cmake versions, like 3.5.
This fix will omit python module inclusion for any cmake version less
than 3.7 and the build will continue without problems.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 15cb7ef9..d302761a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,8 +12,9 @@ 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 +if ((${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.7.0") AND (${CMAKE_VERSION} VERSION_LESS "3.16.0")) + # use backported module from 3.15 (introduced 3.12) to support older versions of cmake. + # this only works with cmake 3.7 or higher. list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/python-backport") endif() |