From 791c9f6b1d4475f213cb435ae79b0f646c36abd0 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Mon, 26 Feb 2018 18:28:58 +0100 Subject: [PATCH] Don't install Python extensions when Python support is disabled --- CMakeLists.txt | 3 +++ src/plugins/CMakeLists.txt | 2 +- src/scripts/CMakeLists.txt | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e3e2285e..ed5a17a3a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -104,6 +104,9 @@ find_package(PythonLibs "3.0") set_package_properties(PySide2 PROPERTIES DESCRIPTION "Python plugins" TYPE OPTIONAL) set_package_properties(Shiboken2 PROPERTIES DESCRIPTION "Python plugins" TYPE OPTIONAL) set_package_properties(PythonLibs PROPERTIES DESCRIPTION "Python plugins" TYPE OPTIONAL) +if (PySide2_FOUND AND Shiboken2_FOUND AND PythonLibs_FOUND) + set(ENABLE_PYTHON_PLUGINS TRUE) +endif() # Git revision if (EXISTS "${CMAKE_SOURCE_DIR}/.git") diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index 2be439be4..f97bd1ac0 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -19,7 +19,7 @@ if (KF5Wallet_FOUND) add_subdirectory(KWalletPasswords) endif() -if (PySide2_FOUND AND Shiboken2_FOUND AND PythonLibs_FOUND) +if (ENABLE_PYTHON_PLUGINS) add_subdirectory(PyFalkon) endif() diff --git a/src/scripts/CMakeLists.txt b/src/scripts/CMakeLists.txt index d7264839b..c1c16cbff 100644 --- a/src/scripts/CMakeLists.txt +++ b/src/scripts/CMakeLists.txt @@ -1,5 +1,7 @@ function(install_python_script name) - install(DIRECTORY ${name} DESTINATION "${FALKON_INSTALL_PLUGINDIR}/python") + if (ENABLE_PYTHON_PLUGINS) + install(DIRECTORY ${name} DESTINATION "${FALKON_INSTALL_PLUGINDIR}/python") + endif() endfunction() install_python_script(hellopython)