diff --git a/CMakeLists.txt b/CMakeLists.txt index 257021890fb34a5d8b0c95189c31f9cc853a853f..45da9af9b5417da7cdbae7ae93b371348baee442 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,19 +27,19 @@ dune_enable_all_packages(MODULE_LIBRARIES dumux_fmt dumux_parameters) # enforce C++-17 dune_require_cxx_standard(MODULE "DuMuX" VERSION 17) +# option for enabling Python bindings +option(DUMUX_ENABLE_PYTHONBINDINGS "Enable Python bindings" ${DUNE_ENABLE_PYTHONBINDINGS}) + add_subdirectory(cmake/modules) add_subdirectory(doc) add_subdirectory(dumux) add_subdirectory(test EXCLUDE_FROM_ALL) add_subdirectory(examples EXCLUDE_FROM_ALL) -# from Dune 2.9 on Python bindings are enabled per default -if(${dune-common_VERSION} VERSION_GREATER_EQUAL 2.9) +# only add bindings folder if Python bindings are enabled +if(DUMUX_ENABLE_PYTHONBINDINGS) add_subdirectory(python) -else() - # with Dune 2.8, only if Python bindings are enabled - if(DUNE_ENABLE_PYTHONBINDINGS) - add_subdirectory(python) + if(${dune-common_VERSION} VERSION_LESS 2.9) dune_python_install_package(PATH "python") endif() endif() diff --git a/dumux/CMakeLists.txt b/dumux/CMakeLists.txt index 3e82f9cdcc945b9b040094becb43b6dfa38c3eb7..1ee5e8770819b72ac80c94f51f168e8eb6bffe5b 100644 --- a/dumux/CMakeLists.txt +++ b/dumux/CMakeLists.txt @@ -17,6 +17,6 @@ add_subdirectory(porousmediumflow) add_subdirectory(timestepping) # if Python bindings are enabled, include necessary sub directories. -if(DUNE_ENABLE_PYTHONBINDINGS) +if(DUMUX_ENABLE_PYTHONBINDINGS) add_subdirectory(python) endif() diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 1ac976185f6cfebe8aae3b8a555c5413de110c8d..a866122647884c4210ac65ef53dfc562f4c8193a 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -16,7 +16,7 @@ add_subdirectory(timestepping) # if Python bindings are enabled, include Python binding tests -if(DUNE_ENABLE_PYTHONBINDINGS) +if(DUMUX_ENABLE_PYTHONBINDINGS) if(${dune-common_VERSION} VERSION_GREATER_EQUAL 2.8) add_subdirectory(python) endif()