summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Podsvirov <konstantin@podsvirov.pro>2015-07-24 07:15:06 (GMT)
committerBrad King <brad.king@kitware.com>2015-07-27 14:30:41 (GMT)
commit068e7962bb8a90ae9ae6b7d6da520a70701820af (patch)
tree196b9da63a763e5a824ed67bbb2843249af0c556
parent42f0155bb9f7cb65c7af103ec1170f4193244d69 (diff)
downloadCMake-068e7962bb8a90ae9ae6b7d6da520a70701820af.zip
CMake-068e7962bb8a90ae9ae6b7d6da520a70701820af.tar.gz
CMake-068e7962bb8a90ae9ae6b7d6da520a70701820af.tar.bz2
CMake: Add CMake_INSTALL_DEPENDENCIES option
By default this option is ON. Turn OFF to disable installing runtime 3rd-party dependencies.
-rw-r--r--CMakeCPack.cmake4
-rw-r--r--CMakeLists.txt5
-rw-r--r--Source/QtDialog/CMakeLists.txt4
3 files changed, 10 insertions, 3 deletions
diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake
index ce10ad0..a0aadcc 100644
--- a/CMakeCPack.cmake
+++ b/CMakeCPack.cmake
@@ -22,7 +22,9 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
endif()
- include(${CMake_SOURCE_DIR}/Modules/InstallRequiredSystemLibraries.cmake)
+ if(CMake_INSTALL_DEPENDENCIES)
+ include(${CMake_SOURCE_DIR}/Modules/InstallRequiredSystemLibraries.cmake)
+ endif()
endif()
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CMake is a build tool")
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5e94028..a47c2ad 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -70,6 +70,11 @@ macro(CMake_OPTIONAL_COMPONENT NAME)
endif()
endmacro()
+# option to disable installing 3rd-party dependencies
+option(CMake_INSTALL_DEPENDENCIES
+ "Whether to install 3rd-party runtime dependencies" ON)
+mark_as_advanced(CMake_INSTALL_DEPENDENCIES)
+
#-----------------------------------------------------------------------
# a macro to deal with system libraries, implemented as a macro
# simply to improve readability of the main script
diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt
index ba993eb..ad6a7fb 100644
--- a/Source/QtDialog/CMakeLists.txt
+++ b/Source/QtDialog/CMakeLists.txt
@@ -39,7 +39,7 @@ if (Qt5Widgets_FOUND)
# We need to install platform plugin and add qt.conf for Qt5 on Mac and Windows.
# FIXME: This should be part of Qt5 CMake scripts, but unfortunatelly
# Qt5 support is missing there.
- if(APPLE OR WIN32)
+ if(CMake_INSTALL_DEPENDENCIES AND (APPLE OR WIN32))
macro(install_qt5_plugin _qt_plugin_name _qt_plugins_var)
get_target_property(_qt_plugin_path "${_qt_plugin_name}" LOCATION)
if(EXISTS "${_qt_plugin_path}")
@@ -213,7 +213,7 @@ if(APPLE)
" ${COMPONENT})
endif()
-if(APPLE OR WIN32)
+if(CMake_INSTALL_DEPENDENCIES AND (APPLE OR WIN32))
# install rules for including 3rd party libs such as Qt
# if a system Qt is used (e.g. installed in /usr/lib/), it will not be included in the installation
set(fixup_exe "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin/cmake-gui${CMAKE_EXECUTABLE_SUFFIX}")