summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:20:13 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:20:13 +0900
commite8d6bf7da6f7f166bcb566ecfd646d20e83f10d2 (patch)
tree599e96d8e4549564632f4bde8d4d8bd9ad360365 /Modules
parentf58f7a233a9b66287e1a0fad0d149e3202a098b4 (diff)
downloadcmake-e8d6bf7da6f7f166bcb566ecfd646d20e83f10d2.tar.gz
cmake-e8d6bf7da6f7f166bcb566ecfd646d20e83f10d2.tar.bz2
cmake-e8d6bf7da6f7f166bcb566ecfd646d20e83f10d2.zip
Imported Upstream version 3.18.1upstream/3.18.1
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeDetermineCompiler.cmake4
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake6
-rw-r--r--Modules/Compiler/Clang.cmake10
-rw-r--r--Modules/CompilerId/Xcode-3.pbxproj.in1
-rw-r--r--Modules/ExternalProject.cmake6
-rw-r--r--Modules/FindCURL.cmake6
-rw-r--r--Modules/FindXalanC.cmake6
7 files changed, 26 insertions, 13 deletions
diff --git a/Modules/CMakeDetermineCompiler.cmake b/Modules/CMakeDetermineCompiler.cmake
index 7cd7c47b8..cb1ab1dbe 100644
--- a/Modules/CMakeDetermineCompiler.cmake
+++ b/Modules/CMakeDetermineCompiler.cmake
@@ -140,7 +140,9 @@ function(_cmake_find_compiler_sysroot lang)
OUTPUT_VARIABLE _cmake_sysroot_run_out
ERROR_VARIABLE _cmake_sysroot_run_err)
- if(_cmake_sysroot_run_out AND NOT _cmake_sysroot_run_err AND IS_DIRECTORY "${_cmake_sysroot_run_out}/usr")
+ if(_cmake_sysroot_run_out AND NOT _cmake_sysroot_run_err
+ AND NOT _cmake_sysroot_run_out STREQUAL "/"
+ AND IS_DIRECTORY "${_cmake_sysroot_run_out}/usr")
file(TO_CMAKE_PATH "${_cmake_sysroot_run_out}/usr" _cmake_sysroot_run_out_usr)
set(CMAKE_${lang}_COMPILER_SYSROOT "${_cmake_sysroot_run_out_usr}" PARENT_SCOPE)
else()
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index df48fa574..44332a66a 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -469,6 +469,12 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
set(id_clang_cxx_library "CLANG_CXX_LIBRARY = \"${CMAKE_MATCH_3}\";")
endif()
endif()
+ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_OSX_SYSROOT MATCHES "^$|[Mm][Aa][Cc][Oo][Ss]")
+ # When targeting macOS, use only the host architecture.
+ set(id_archs [[ARCHS = "$(NATIVE_ARCH_ACTUAL)";]])
+ else()
+ set(id_archs "")
+ endif()
configure_file(${CMAKE_ROOT}/Modules/CompilerId/Xcode-3.pbxproj.in
${id_dir}/CompilerId${lang}.xcodeproj/project.pbxproj @ONLY)
unset(_ENV_MACOSX_DEPLOYMENT_TARGET)
diff --git a/Modules/Compiler/Clang.cmake b/Modules/Compiler/Clang.cmake
index bb516d3a2..52d5350a3 100644
--- a/Modules/Compiler/Clang.cmake
+++ b/Modules/Compiler/Clang.cmake
@@ -222,11 +222,11 @@ macro(__compiler_clang_cxx_standards lang)
# can be attempted.
macro(cmake_record_${lang}_compile_features)
list(APPEND CMAKE_${lang}_COMPILE_FEATURES
- ${lang}_std_98
- ${lang}_std_11
- ${lang}_std_14
- ${lang}_std_17
- ${lang}_std_20
+ cxx_std_98
+ cxx_std_11
+ cxx_std_14
+ cxx_std_17
+ cxx_std_20
)
_record_compiler_features(${lang} "" CMAKE_${lang}_COMPILE_FEATURES)
endmacro()
diff --git a/Modules/CompilerId/Xcode-3.pbxproj.in b/Modules/CompilerId/Xcode-3.pbxproj.in
index 672044e13..6fe17e541 100644
--- a/Modules/CompilerId/Xcode-3.pbxproj.in
+++ b/Modules/CompilerId/Xcode-3.pbxproj.in
@@ -84,6 +84,7 @@
CODE_SIGNING_REQUIRED = NO;
CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)";
SYMROOT = .;
+ @id_archs@
@id_toolset@
@id_lang_version@
@id_clang_cxx_library@
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 3a47090a7..aecc00b3b 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -1124,7 +1124,11 @@ function(_ep_write_gitclone_script script_filename source_dir git_EXECUTABLE git
message(FATAL_ERROR "Tag for git checkout should not be empty.")
endif()
- set(git_clone_options "--no-checkout")
+ if(GIT_VERSION_STRING VERSION_LESS 2.20 OR 2.21 VERSION_LESS_EQUAL GIT_VERSION_STRING)
+ set(git_clone_options "--no-checkout")
+ else()
+ set(git_clone_options)
+ endif()
if(git_shallow)
if(NOT GIT_VERSION_STRING VERSION_LESS 1.7.10)
list(APPEND git_clone_options "--depth 1 --no-single-branch")
diff --git a/Modules/FindCURL.cmake b/Modules/FindCURL.cmake
index 919babcde..be7e16ea5 100644
--- a/Modules/FindCURL.cmake
+++ b/Modules/FindCURL.cmake
@@ -148,16 +148,16 @@ if(CURL_FIND_COMPONENTS)
endif()
foreach(component IN LISTS CURL_FIND_COMPONENTS)
list(FIND CURL_KNOWN_PROTOCOLS ${component} _found)
- if(_found)
+ if(NOT _found EQUAL -1)
list(FIND CURL_SUPPORTED_PROTOCOLS ${component} _found)
- if(_found)
+ if(NOT _found EQUAL -1)
set(CURL_${component}_FOUND TRUE)
elseif(CURL_FIND_REQUIRED)
message(FATAL_ERROR "CURL: Required protocol ${component} is not found")
endif()
else()
list(FIND CURL_SUPPORTED_FEATURES ${component} _found)
- if(_found)
+ if(NOT _found EQUAL -1)
set(CURL_${component}_FOUND TRUE)
elseif(CURL_FIND_REQUIRED)
message(FATAL_ERROR "CURL: Required feature ${component} is not found")
diff --git a/Modules/FindXalanC.cmake b/Modules/FindXalanC.cmake
index 3adaa44d3..54783e394 100644
--- a/Modules/FindXalanC.cmake
+++ b/Modules/FindXalanC.cmake
@@ -47,9 +47,9 @@ The following cache variables may also be set:
function(_XalanC_GET_VERSION version_hdr)
file(STRINGS ${version_hdr} _contents REGEX "^[ \t]*#define XALAN_VERSION_.*")
if(_contents)
- string(REGEX REPLACE "[^*]*#define XALAN_VERSION_MAJOR[ \t]+([0-9]+).*" "\\1" XalanC_MAJOR "${_contents}")
- string(REGEX REPLACE "[^*]*#define XALAN_VERSION_MINOR[ \t]+([0-9]+).*" "\\1" XalanC_MINOR "${_contents}")
- string(REGEX REPLACE "[^*]*#define XALAN_VERSION_REVISION[ \t]+([0-9]+).*" "\\1" XalanC_PATCH "${_contents}")
+ string(REGEX REPLACE "[^*]*#define XALAN_VERSION_MAJOR[ \t(]+([0-9]+).*" "\\1" XalanC_MAJOR "${_contents}")
+ string(REGEX REPLACE "[^*]*#define XALAN_VERSION_MINOR[ \t(]+([0-9]+).*" "\\1" XalanC_MINOR "${_contents}")
+ string(REGEX REPLACE "[^*]*#define XALAN_VERSION_REVISION[ \t(]+([0-9]+).*" "\\1" XalanC_PATCH "${_contents}")
if(NOT XalanC_MAJOR MATCHES "^[0-9]+$")
message(FATAL_ERROR "Version parsing failed for XALAN_VERSION_MAJOR!")