summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Modules/CPackRPM.cmake8
-rw-r--r--Modules/InstallRequiredSystemLibraries.cmake26
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/cmCMakeHostSystemInformationCommand.cxx13
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx14
-rw-r--r--Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake8
-rw-r--r--Tests/RunCMake/CPack/RPM/Helpers.cmake4
-rw-r--r--Tests/RunCMake/CPack/tests/SOURCE_PACKAGE/VerifyResult.cmake4
8 files changed, 53 insertions, 26 deletions
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index 87fa9ddf66..e905bc6122 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -721,14 +721,6 @@
# Debuginfo packages contain debug symbols and sources for debugging packaged
# binaries.
#
-# .. note::
-#
-# Currently multiple debuginfo packages are generated if component based
-# packaging is used - one debuginfo package per component. This duplicates
-# sources if multiple binaries are using them. This is a side effect of
-# how CPackRPM currently generates component packages and will be addressed
-# in later versions of the generator.
-#
# Debuginfo RPM packaging has it's own set of variables:
#
# .. variable:: CPACK_RPM_DEBUGINFO_PACKAGE
diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake
index 1061da0b05..a3478a387f 100644
--- a/Modules/InstallRequiredSystemLibraries.cmake
+++ b/Modules/InstallRequiredSystemLibraries.cmake
@@ -191,19 +191,31 @@ if(MSVC)
set(vs "${_MSVCRT_IDE_VERSION}")
# Find the runtime library redistribution directory.
- get_filename_component(msvc_install_dir
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\${vs}.0;InstallDir]" ABSOLUTE)
- set(programfilesx86 "ProgramFiles(x86)")
if(vs VERSION_LESS 15 AND DEFINED MSVC${vs}_REDIST_DIR AND EXISTS "${MSVC${vs}_REDIST_DIR}")
set(MSVC_REDIST_DIR "${MSVC${vs}_REDIST_DIR}") # use old cache entry
endif()
- find_path(MSVC_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC${vs}0.CRT
- PATHS
- "${msvc_install_dir}/../../VC/redist"
+ if(NOT vs VERSION_LESS 15)
+ set(_vs_redist_paths "")
+ cmake_host_system_information(RESULT _vs_dir QUERY VS_${vs}_DIR) # undocumented query
+ if(IS_DIRECTORY "${_vs_dir}")
+ file(GLOB _vs_redist_paths "${_vs_dir}/VC/Redist/MSVC/*")
+ endif()
+ unset(_vs_dir)
+ else()
+ get_filename_component(_vs_dir
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\${vs}.0;InstallDir]" ABSOLUTE)
+ set(programfilesx86 "ProgramFiles(x86)")
+ set(_vs_redist_paths
+ "${_vs_dir}/../../VC/redist"
"${base_dir}/VC/redist"
"$ENV{ProgramFiles}/Microsoft Visual Studio ${vs}.0/VC/redist"
"$ENV{${programfilesx86}}/Microsoft Visual Studio ${vs}.0/VC/redist"
- )
+ )
+ unset(_vs_dir)
+ unset(programfilesx86)
+ endif()
+ find_path(MSVC_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC${vs}0.CRT PATHS ${_vs_redist_paths})
+ unset(_vs_redist_paths)
mark_as_advanced(MSVC_REDIST_DIR)
set(MSVC_CRT_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${vs}0.CRT")
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index e2b8d4ff91..8ae8b33276 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -2,4 +2,4 @@
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 8)
set(CMake_VERSION_PATCH 0)
-set(CMake_VERSION_RC 2)
+set(CMake_VERSION_RC 3)
diff --git a/Source/cmCMakeHostSystemInformationCommand.cxx b/Source/cmCMakeHostSystemInformationCommand.cxx
index 7da93ace85..e135ac690e 100644
--- a/Source/cmCMakeHostSystemInformationCommand.cxx
+++ b/Source/cmCMakeHostSystemInformationCommand.cxx
@@ -7,6 +7,12 @@
#include "cmMakefile.h"
#include "cmsys/SystemInformation.hxx"
+#if defined(_WIN32)
+#include "cmSystemTools.h"
+#include "cmVSSetupHelper.h"
+#define HAVE_VS_SETUP_HELPER
+#endif
+
class cmExecutionStatus;
// cmCMakeHostSystemInformation
@@ -70,6 +76,13 @@ bool cmCMakeHostSystemInformationCommand::GetValue(
value = this->ValueToString(info.GetTotalPhysicalMemory());
} else if (key == "AVAILABLE_PHYSICAL_MEMORY") {
value = this->ValueToString(info.GetAvailablePhysicalMemory());
+#ifdef HAVE_VS_SETUP_HELPER
+ } else if (key == "VS_15_DIR") {
+ cmVSSetupAPIHelper vsSetupAPIHelper;
+ if (vsSetupAPIHelper.GetVSInstanceInfo(value)) {
+ cmSystemTools::ConvertToUnixSlashes(value);
+ }
+#endif
} else {
std::string e = "does not recognize <key> " + key;
this->SetError(e);
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 4fc664d8f2..b1374c27bb 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -550,10 +550,6 @@ static int calculateCommandLineLengthLimit(int linkRuleLength)
#ifdef _WIN32
8000,
#endif
-#if defined(_SC_ARG_MAX)
- // for instance ARG_MAX is 2096152 on Ubuntu or 262144 on Mac
- ((int)sysconf(_SC_ARG_MAX)) - 1000,
-#endif
#if defined(__linux)
// #define MAX_ARG_STRLEN (PAGE_SIZE * 32) in Linux's binfmts.h
((int)sysconf(_SC_PAGESIZE) * 32) - 1000,
@@ -562,7 +558,15 @@ static int calculateCommandLineLengthLimit(int linkRuleLength)
};
size_t const arrSz = cmArraySize(limits);
- int const sz = *std::min_element(limits, limits + arrSz);
+ int sz = *std::min_element(limits, limits + arrSz);
+#if defined(_SC_ARG_MAX)
+ // for instance ARG_MAX is 2096152 on Ubuntu or 262144 on Mac
+ int const szArgMax = static_cast<int>(sysconf(_SC_ARG_MAX));
+ // a return value of -1 signifies an unrestricted value
+ if (szArgMax != -1) {
+ sz = std::min(sz, szArgMax - 1000);
+ }
+#endif
if (sz == std::numeric_limits<int>::max()) {
return 0;
}
diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
index fc90d09256..a5b38fdb6a 100644
--- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
+++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
@@ -205,14 +205,14 @@ if(CPackGen MATCHES "RPM")
/usr/foo/bar/non_relocatable/depth_two
/usr/foo/bar/non_relocatable/depth_two/symlink_from_non_relocatable_path
/usr/foo/bar/other_relocatable
-/usr/foo/bar/other_relocatable/depth_two$")
+/usr/foo/bar/other_relocatable/depth_two(\n.*\.build-id.*)*$")
elseif(check_file_headers_match)
set(check_file_match_expected_summary ".*${CPACK_RPM_HEADERS_PACKAGE_SUMMARY}.*")
set(check_file_match_expected_description ".*${CPACK_RPM_HEADERS_PACKAGE_DESCRIPTION}.*")
set(check_file_match_expected_relocation_path "Relocations${whitespaces}:${whitespaces}${CPACK_PACKAGING_INSTALL_PREFIX}${whitespaces}${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}")
set(check_file_match_expected_architecture "noarch")
set(spec_regex "*headers*")
- set(check_content_list "^/usr/foo/bar\n/usr/foo/bar/include\n/usr/foo/bar/include/mylib.h$")
+ set(check_content_list "^/usr/foo/bar\n/usr/foo/bar/include\n/usr/foo/bar/include/mylib.h(\n.*\.build-id.*)*$")
elseif(check_file_applications_match)
set(check_file_match_expected_summary ".*${CPACK_RPM_PACKAGE_SUMMARY}.*")
set(check_file_match_expected_description ".*${CPACK_COMPONENT_APPLICATIONS_DESCRIPTION}.*")
@@ -221,7 +221,7 @@ if(CPackGen MATCHES "RPM")
set(spec_regex "*applications*")
set(check_content_list "^/usr/foo/bar
/usr/foo/bar/bin
-/usr/foo/bar/bin/mylibapp$")
+/usr/foo/bar/bin/mylibapp(\n.*\.build-id.*)*$")
elseif(check_file_Unspecified_match)
set(check_file_match_expected_summary ".*${CPACK_RPM_PACKAGE_SUMMARY}.*")
set(check_file_match_expected_description ".*DESCRIPTION.*")
@@ -241,7 +241,7 @@ if(CPackGen MATCHES "RPM")
/usr/foo/bar/share/man/mylib/man3
/usr/foo/bar/share/man/mylib/man3/mylib.1
/usr/foo/bar/share/man/mylib/man3/mylib.1/mylib
-/usr/foo/bar/share/man/mylib/man3/mylib.1/mylib2$")
+/usr/foo/bar/share/man/mylib/man3/mylib.1/mylib2(\n.*\.build-id.*)*$")
else()
message(FATAL_ERROR "error: unexpected rpm package '${check_file}'")
endif()
diff --git a/Tests/RunCMake/CPack/RPM/Helpers.cmake b/Tests/RunCMake/CPack/RPM/Helpers.cmake
index bbc358c81b..d8012b11bb 100644
--- a/Tests/RunCMake/CPack/RPM/Helpers.cmake
+++ b/Tests/RunCMake/CPack/RPM/Helpers.cmake
@@ -36,6 +36,10 @@ function(getPackageContentList FILE RESULT_VAR)
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REGEX REPLACE "\n" ";" package_content_ "${package_content_}")
+ # never versions of rpmbuild (introduced in rpm 4.13.0.1) add build_id links
+ # to packages - tests should ignore them
+ list(FILTER package_content_ EXCLUDE REGEX ".*\.build-id.*")
+
set(${RESULT_VAR} "${package_content_}" PARENT_SCOPE)
endfunction()
diff --git a/Tests/RunCMake/CPack/tests/SOURCE_PACKAGE/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/SOURCE_PACKAGE/VerifyResult.cmake
index bc54d79208..73d7481f15 100644
--- a/Tests/RunCMake/CPack/tests/SOURCE_PACKAGE/VerifyResult.cmake
+++ b/Tests/RunCMake/CPack/tests/SOURCE_PACKAGE/VerifyResult.cmake
@@ -21,7 +21,9 @@ execute_process(COMMAND ${RPMBUILD_EXECUTABLE} --define "_topdir ${CMAKE_CURRENT
set(output_error_message_
"\n${RPMBUILD_EXECUTABLE} error: '${error_}';\nresult: '${result_}';\n${output_error_message}")
-set(EXPECTED_FILE_CONTENT_ "^/foo${whitespaces_}/foo/test_prog$")
+# expected file content are test_prog and optional build-id links that are
+# generated by rpmbuild (introduced in rpm 4.13.0.1)
+set(EXPECTED_FILE_CONTENT_ "^/foo${whitespaces_}/foo/test_prog(${whitespaces_}.*\.build-id.*)*$")
file(GLOB_RECURSE FOUND_FILE_ RELATIVE "${CMAKE_CURRENT_BINARY_DIR}/test_rpm/RPMS" "${CMAKE_CURRENT_BINARY_DIR}/test_rpm/RPMS/*.rpm")
list(APPEND foundFiles_ "${FOUND_FILE_}")