summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CPackDeb.cmake68
-rw-r--r--Modules/CPackRPM.cmake7
-rw-r--r--Modules/ExternalProject.cmake13
-rw-r--r--Modules/FindFLTK.cmake15
-rw-r--r--Modules/FindFLTK2.cmake13
-rw-r--r--Modules/Platform/Windows-GNU.cmake2
6 files changed, 69 insertions, 49 deletions
diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake
index d1d5d09..0ccb042 100644
--- a/Modules/CPackDeb.cmake
+++ b/Modules/CPackDeb.cmake
@@ -48,11 +48,31 @@
# The debian package architecture
#
# .. variable:: CPACK_DEBIAN_PACKAGE_DEPENDS
+# CPACK_DEBIAN_<COMPONENT>_PACKAGE_DEPENDS
+#
+# May be used to set deb dependencies.
#
# * Mandatory : NO
-# * Default : -
+# * Default :
#
-# May be used to set deb dependencies.
+# - An empty string for non-component based installations
+# - :variable:`CPACK_DEBIAN_PACKAGE_DEPENDS` for component-based
+# installations.
+#
+# .. note::
+#
+# If :variable:`CPACK_DEBIAN_PACKAGE_SHLIBDEPS` or
+# more specifically :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_SHLIBDEPS`
+# is set for this component, the discovered dependencies will be appended
+# to :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_DEPENDS` intead of
+# :variable:`CPACK_DEBIAN_PACKAGE_DEPENDS`. If
+# :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_DEPENDS` is an empty string,
+# only the automatically discovered dependencies will be set for this
+# component.
+#
+# Example::
+#
+# set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.3.1-6), libc6 (< 2.4)")
#
# .. variable:: CPACK_DEBIAN_PACKAGE_MAINTAINER
#
@@ -356,33 +376,24 @@ function(cpack_deb_prepare_package_vars)
string(REGEX REPLACE "^.*Depends=" "" CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS "${SHLIBDEPS_OUTPUT}")
if(CPACK_DEBIAN_PACKAGE_DEBUG)
- message( "CPackDeb Debug: Found dependency: ${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}")
+ message("CPackDeb Debug: Found dependency: ${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS} from output ${SHLIBDEPS_OUTPUT}")
endif()
# Remove blank control file
# Might not be safe if package actual contain file or directory named debian
file(REMOVE_RECURSE "${CPACK_TEMPORARY_DIRECTORY}/debian")
-
- # Append user depend if set
- if(CPACK_DEBIAN_PACKAGE_DEPENDS)
- set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}, ${CPACK_DEBIAN_PACKAGE_DEPENDS}")
- else()
- set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}")
- endif()
else()
if(CPACK_DEBIAN_PACKAGE_DEBUG)
- message( "CPackDeb Debug: Using only user-provided depends because package does not contain executable files that contain dynamically linked libraries.")
+ message(AUTHOR_WARNING "CPackDeb Debug: Using only user-provided depends because package does not contain executable files that link to shared libraries.")
endif()
endif()
else()
- if(CPACK_DEBIAN_PACKAGE_DEBUG)
- message( "CPackDeb Debug: Using only user-provided depends because dpkg-shlibdeps is not found.")
- endif()
+ message("CPackDeb: Using only user-provided dependencies because dpkg-shlibdeps is not found.")
endif()
else()
if(CPACK_DEBIAN_PACKAGE_DEBUG)
- message( "CPackDeb Debug: Using only user-provided depends")
+ message("CPackDeb Debug: Using only user-provided dependencies")
endif()
endif()
@@ -426,6 +437,33 @@ function(cpack_deb_prepare_package_vars)
# Depends:
# You should set: DEBIAN_PACKAGE_DEPENDS
# TODO: automate 'objdump -p | grep NEEDED'
+
+ # if per-component dependency, overrides the global CPACK_DEBIAN_PACKAGE_DEPENDS
+ # automatic dependency discovery will be performed afterwards.
+ if(CPACK_DEB_PACKAGE_COMPONENT)
+ string(TOUPPER "${CPACK_DEB_PACKAGE_COMPONENT}" _local_component_name)
+ set(_component_depends_var "CPACK_DEBIAN_${_local_component_name}_PACKAGE_DEPENDS")
+
+ # if set, overrides the global dependency
+ if(DEFINED ${_component_depends_var})
+ set(CPACK_DEBIAN_PACKAGE_DEPENDS "${${_component_depends_var}}")
+ if(CPACK_DEBIAN_PACKAGE_DEBUG)
+ message("CPackDeb Debug: component '${_local_component_name}' dependencies set to '${CPACK_DEBIAN_PACKAGE_DEPENDS}'")
+ endif()
+ endif()
+ endif()
+
+ # at this point, the CPACK_DEBIAN_PACKAGE_DEPENDS is properly set
+ # to the minimal dependency of the package
+ # Append automatically discovered dependencies .
+ if(NOT "${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}" STREQUAL "")
+ if (CPACK_DEBIAN_PACKAGE_DEPENDS)
+ set (CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}, ${CPACK_DEBIAN_PACKAGE_DEPENDS}")
+ else ()
+ set (CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}")
+ endif ()
+ endif()
+
if(NOT CPACK_DEBIAN_PACKAGE_DEPENDS)
message(STATUS "CPACK_DEBIAN_PACKAGE_DEPENDS not set, the package will have no dependencies.")
endif()
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index e672e72..cb77fb8 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -1197,18 +1197,17 @@ function(cpack_rpm_generate_package)
set(CPACK_RPM_COMPRESSION_TYPE_TMP "")
endif()
- if(CPACK_PACKAGE_RELOCATABLE)
- set(CPACK_RPM_PACKAGE_RELOCATABLE TRUE)
- endif()
- if(CPACK_RPM_PACKAGE_RELOCATABLE)
+ if(CPACK_PACKAGE_RELOCATABLE OR CPACK_RPM_PACKAGE_RELOCATABLE)
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: Trying to build a relocatable package")
endif()
if(CPACK_SET_DESTDIR AND (NOT CPACK_SET_DESTDIR STREQUAL "I_ON"))
message("CPackRPM:Warning: CPACK_SET_DESTDIR is set (=${CPACK_SET_DESTDIR}) while requesting a relocatable package (CPACK_RPM_PACKAGE_RELOCATABLE is set): this is not supported, the package won't be relocatable.")
+ set(CPACK_RPM_PACKAGE_RELOCATABLE FALSE)
else()
set(CPACK_RPM_PACKAGE_PREFIX ${CPACK_PACKAGING_INSTALL_PREFIX}) # kept for back compatibility (provided external RPM spec files)
cpack_rpm_prepare_relocation_paths()
+ set(CPACK_RPM_PACKAGE_RELOCATABLE TRUE)
endif()
endif()
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 97bebc0..7cf9d79 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -1866,7 +1866,18 @@ function(_ep_add_download_command name)
else()
_ep_is_dir_empty("${source_dir}" empty)
if(${empty})
- message(SEND_ERROR "error: no download info for '${name}' -- please specify existing/non-empty SOURCE_DIR or one of URL, CVS_REPOSITORY and CVS_MODULE, SVN_REPOSITORY, GIT_REPOSITORY, HG_REPOSITORY or DOWNLOAD_COMMAND")
+ message(SEND_ERROR
+ "No download info given for '${name}' and its source directory:\n"
+ " ${source_dir}\n"
+ "is not an existing non-empty directory. Please specify one of:\n"
+ " * SOURCE_DIR with an existing non-empty directory\n"
+ " * URL\n"
+ " * GIT_REPOSITORY\n"
+ " * HG_REPOSITORY\n"
+ " * CVS_REPOSITORY and CVS_MODULE\n"
+ " * SVN_REVISION\n"
+ " * DOWNLOAD_COMMAND"
+ )
endif()
endif()
diff --git a/Modules/FindFLTK.cmake b/Modules/FindFLTK.cmake
index 76f702e..ad0bf98 100644
--- a/Modules/FindFLTK.cmake
+++ b/Modules/FindFLTK.cmake
@@ -131,21 +131,6 @@ if(NOT FLTK_DIR)
/usr/local/fltk
/usr/X11R6/include
- # Read from the CMakeSetup registry entries. It is likely that
- # FLTK will have been recently built.
- # TODO: Is this really a good idea? I can already hear the user screaming, "But
- # it worked when I configured the build LAST week!"
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild1]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild2]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild3]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild4]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild5]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild6]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild7]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild8]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild9]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild10]
-
# Help the user find it if we cannot.
DOC "The ${FLTK_DIR_STRING}"
)
diff --git a/Modules/FindFLTK2.cmake b/Modules/FindFLTK2.cmake
index 930acca..154729f 100644
--- a/Modules/FindFLTK2.cmake
+++ b/Modules/FindFLTK2.cmake
@@ -96,19 +96,6 @@ if(NOT FLTK2_DIR)
/usr/local/fltk2
/usr/X11R6/include
- # Read from the CMakeSetup registry entries. It is likely that
- # FLTK2 will have been recently built.
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild1]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild2]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild3]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild4]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild5]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild6]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild7]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild8]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild9]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild10]
-
# Help the user find it if we cannot.
DOC "The ${FLTK2_DIR_STRING}"
)
diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake
index c0d7d8c..b571b16 100644
--- a/Modules/Platform/Windows-GNU.cmake
+++ b/Modules/Platform/Windows-GNU.cmake
@@ -138,7 +138,7 @@ macro(__windows_compiler_gnu lang)
endforeach()
endif()
- if(NOT CMAKE_RC_COMPILER_INIT)
+ if(NOT CMAKE_RC_COMPILER_INIT AND NOT CMAKE_GENERATOR_RC)
set(CMAKE_RC_COMPILER_INIT windres)
endif()