summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:13:26 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:13:26 +0900
commite7ff50712c4a21dd73051147cb71225f63e05bcf (patch)
treeeaabc8bd601d045807d8548b1a22980fae568f59 /Modules
parente42c4abb646a39cdd5d1ccb22a9619990ce2a898 (diff)
downloadcmake-e7ff50712c4a21dd73051147cb71225f63e05bcf.tar.gz
cmake-e7ff50712c4a21dd73051147cb71225f63e05bcf.tar.bz2
cmake-e7ff50712c4a21dd73051147cb71225f63e05bcf.zip
Imported Upstream version 3.12.1upstream/3.12.1
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeCSharpCompiler.cmake.in1
-rw-r--r--Modules/CPack.cmake27
-rw-r--r--Modules/FindCUDA/select_compute_arch.cmake5
-rw-r--r--Modules/FindPython/Support.cmake6
-rw-r--r--Modules/FindTCL.cmake6
-rw-r--r--Modules/FindTclStub.cmake2
-rw-r--r--Modules/FindTclsh.cmake1
-rw-r--r--Modules/GoogleTest.cmake7
-rw-r--r--Modules/UseSWIG.cmake9
9 files changed, 41 insertions, 23 deletions
diff --git a/Modules/CMakeCSharpCompiler.cmake.in b/Modules/CMakeCSharpCompiler.cmake.in
index 5ecc4800b..3d49b6bc9 100644
--- a/Modules/CMakeCSharpCompiler.cmake.in
+++ b/Modules/CMakeCSharpCompiler.cmake.in
@@ -2,6 +2,7 @@ set(CMAKE_CSharp_COMPILER "@CMAKE_CSharp_COMPILER@")
set(CMAKE_CSharp_COMPILER_ID "@CMAKE_CSharp_COMPILER_ID@")
set(CMAKE_CSharp_COMPILER_VERSION "@CMAKE_CSharp_COMPILER_VERSION@")
+set(CMAKE_CSharp_COMPILER_LOADED 1)
set(CMAKE_CSharp_COMPILER_WORKS "@CMAKE_CSharp_COMPILER_WORKS@")
set(CMAKE_CSharp_COMPILER_ID_RUN "@CMAKE_CSharp_COMPILER_ID_RUN@")
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index 80708690a..cdc38a6a9 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -403,28 +403,31 @@ endfunction()
# Set the package name
_cpack_set_default(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
-if(CMAKE_PROJECT_VERSION_MAJOR)
+
+# Set the package version
+if(CMAKE_PROJECT_VERSION_MAJOR GREATER_EQUAL 0)
_cpack_set_default(CPACK_PACKAGE_VERSION_MAJOR "${CMAKE_PROJECT_VERSION_MAJOR}")
- if(CMAKE_PROJECT_VERSION_MINOR)
+ if(CMAKE_PROJECT_VERSION_MINOR GREATER_EQUAL 0)
_cpack_set_default(CPACK_PACKAGE_VERSION_MINOR "${CMAKE_PROJECT_VERSION_MINOR}")
- if(CMAKE_PROJECT_VERSION_PATCH)
+ if(CMAKE_PROJECT_VERSION_PATCH GREATER_EQUAL 0)
_cpack_set_default(CPACK_PACKAGE_VERSION_PATCH "${CMAKE_PROJECT_VERSION_PATCH}")
- _cpack_set_default(CPACK_PACKAGE_VERSION
- "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
- else()
- _cpack_set_default(CPACK_PACKAGE_VERSION
- "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")
endif()
- else()
- _cpack_set_default(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}")
endif()
else()
_cpack_set_default(CPACK_PACKAGE_VERSION_MAJOR "0")
_cpack_set_default(CPACK_PACKAGE_VERSION_MINOR "1")
_cpack_set_default(CPACK_PACKAGE_VERSION_PATCH "1")
- _cpack_set_default(CPACK_PACKAGE_VERSION
- "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
endif()
+if(NOT DEFINED CPACK_PACKAGE_VERSION)
+ set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}")
+ if(CPACK_PACKAGE_VERSION_MINOR GREATER_EQUAL 0)
+ string(APPEND CPACK_PACKAGE_VERSION ".${CPACK_PACKAGE_VERSION_MINOR}")
+ if(CPACK_PACKAGE_VERSION_PATCH GREATER_EQUAL 0)
+ string(APPEND CPACK_PACKAGE_VERSION ".${CPACK_PACKAGE_VERSION_PATCH}")
+ endif()
+ endif()
+endif()
+
_cpack_set_default(CPACK_PACKAGE_VENDOR "Humanity")
if(CMAKE_PROJECT_DESCRIPTION)
_cpack_set_default(CPACK_PACKAGE_DESCRIPTION_SUMMARY
diff --git a/Modules/FindCUDA/select_compute_arch.cmake b/Modules/FindCUDA/select_compute_arch.cmake
index 22c04df0e..cf4fc39df 100644
--- a/Modules/FindCUDA/select_compute_arch.cmake
+++ b/Modules/FindCUDA/select_compute_arch.cmake
@@ -18,8 +18,9 @@
#
if(CMAKE_CUDA_COMPILER_LOADED) # CUDA as a language
- if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA")
- set(CUDA_VERSION "${CMAKE_CUDA_COMPILER_VERSION}")
+ if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA"
+ AND CMAKE_CUDA_COMPILER_VERSION MATCHES "^([0-9]+\\.[0-9]+)")
+ set(CUDA_VERSION "${CMAKE_MATCH_1}")
endif()
endif()
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake
index 08f07fdaf..fe3df9119 100644
--- a/Modules/FindPython/Support.cmake
+++ b/Modules/FindPython/Support.cmake
@@ -196,10 +196,6 @@ endif()
set (CMAKE_FIND_FRAMEWORK LAST)
-unset (${_PYTHON_PREFIX}_VERSION_MAJOR)
-unset (${_PYTHON_PREFIX}_VERSION_MINOR)
-unset (${_PYTHON_PREFIX}_VERSION_PATCH)
-
unset (_${_PYTHON_PREFIX}_REQUIRED_VARS)
unset (_${_PYTHON_PREFIX}_CACHED_VARS)
@@ -259,7 +255,7 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
# try more generic names
if (NOT ${_PYTHON_PREFIX}_EXECUTABLE)
find_program (${_PYTHON_PREFIX}_EXECUTABLE
- NAMES python${${_PYTHON_PREFIX}_VERSION_MAJOR} python
+ NAMES python${_${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR} python
${_${_PYTHON_PREFIX}_IRON_PYTHON_NAMES}
HINTS ${_${_PYTHON_PREFIX}_HINTS}
PATH_SUFFIXES bin)
diff --git a/Modules/FindTCL.cmake b/Modules/FindTCL.cmake
index 19eb9329f..ad16e0de1 100644
--- a/Modules/FindTCL.cmake
+++ b/Modules/FindTCL.cmake
@@ -85,6 +85,8 @@ set(TCLTK_POSSIBLE_LIB_PATHS
)
set(TCLTK_POSSIBLE_LIB_PATH_SUFFIXES
+ lib/tcl/tcl8.7
+ lib/tcl/tk8.7
lib/tcl/tcl8.6
lib/tcl/tk8.6
lib/tcl/tcl8.5
@@ -116,6 +118,7 @@ find_library(TCL_LIBRARY
NAMES
tcl
tcl${TCL_LIBRARY_VERSION} tcl${TCL_TCLSH_VERSION} tcl${TK_WISH_VERSION}
+ tcl87 tcl8.7 tcl87t tcl8.7t
tcl86 tcl8.6 tcl86t tcl8.6t
tcl85 tcl8.5
tcl84 tcl8.4
@@ -130,6 +133,7 @@ find_library(TK_LIBRARY
NAMES
tk
tk${TK_LIBRARY_VERSION} tk${TCL_TCLSH_VERSION} tk${TK_WISH_VERSION}
+ tk87 tk8.7 tk87t tk8.7t
tk86 tk8.6 tk86t tk8.6t
tk85 tk8.5
tk84 tk8.4
@@ -176,6 +180,8 @@ set(TCLTK_POSSIBLE_INCLUDE_PATHS
set(TCLTK_POSSIBLE_INCLUDE_PATH_SUFFIXES
include/tcl${TK_LIBRARY_VERSION}
include/tcl${TCL_LIBRARY_VERSION}
+ include/tcl8.7
+ include/tk8.7
include/tcl8.6
include/tk8.6
include/tcl8.5
diff --git a/Modules/FindTclStub.cmake b/Modules/FindTclStub.cmake
index 51fc02933..db0a7a176 100644
--- a/Modules/FindTclStub.cmake
+++ b/Modules/FindTclStub.cmake
@@ -101,6 +101,7 @@ find_library(TCL_STUB_LIBRARY
NAMES
tclstub
tclstub${TK_LIBRARY_VERSION} tclstub${TCL_TCLSH_VERSION} tclstub${TK_WISH_VERSION}
+ tclstub87 tclstub8.7
tclstub86 tclstub8.6
tclstub85 tclstub8.5
tclstub84 tclstub8.4
@@ -114,6 +115,7 @@ find_library(TK_STUB_LIBRARY
NAMES
tkstub
tkstub${TCL_LIBRARY_VERSION} tkstub${TCL_TCLSH_VERSION} tkstub${TK_WISH_VERSION}
+ tkstub87 tkstub8.7
tkstub86 tkstub8.6
tkstub85 tkstub8.5
tkstub84 tkstub8.4
diff --git a/Modules/FindTclsh.cmake b/Modules/FindTclsh.cmake
index 9fcb41cb4..9bf935d8e 100644
--- a/Modules/FindTclsh.cmake
+++ b/Modules/FindTclsh.cmake
@@ -68,6 +68,7 @@ endif()
set(TCL_TCLSH_NAMES
tclsh
tclsh${TCL_LIBRARY_VERSION} tclsh${TK_LIBRARY_VERSION} tclsh${TK_WISH_VERSION}
+ tclsh87 tclsh8.7
tclsh86 tclsh8.6
tclsh85 tclsh8.5
tclsh84 tclsh8.4
diff --git a/Modules/GoogleTest.cmake b/Modules/GoogleTest.cmake
index bfb83e1b4..2c9ee1180 100644
--- a/Modules/GoogleTest.cmake
+++ b/Modules/GoogleTest.cmake
@@ -238,6 +238,10 @@ same as the Google Test name (i.e. ``suite.testcase``); see also
#]=======================================================================]
+# Save project's policies
+cmake_policy(PUSH)
+cmake_policy(SET CMP0057 NEW) # if IN_LIST
+
#------------------------------------------------------------------------------
function(gtest_add_tests)
@@ -454,3 +458,6 @@ endfunction()
set(_GOOGLETEST_DISCOVER_TESTS_SCRIPT
${CMAKE_CURRENT_LIST_DIR}/GoogleTestAddTests.cmake
)
+
+# Restore project's policies
+cmake_policy(POP)
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index b30618129..b7b9fe1a1 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -241,7 +241,6 @@ macro(SWIG_MODULE_INITIALIZE name language)
string(TOUPPER "${language}" SWIG_MODULE_${name}_LANGUAGE)
string(TOLOWER "${language}" SWIG_MODULE_${name}_SWIG_LANGUAGE_FLAG)
- set(SWIG_MODULE_${name}_EXTRA_FLAGS)
if (NOT DEFINED SWIG_MODULE_${name}_NOPROXY)
set (SWIG_MODULE_${name}_NOPROXY FALSE)
endif()
@@ -249,12 +248,14 @@ macro(SWIG_MODULE_INITIALIZE name language)
set (SWIG_MODULE_${name}_NOPROXY TRUE)
endif ()
- if (SWIG_MODULE_${name}_NOPROXY AND NOT "-noproxy" IN_LIST CMAKE_SWIG_FLAGS)
+ if (SWIG_MODULE_${name}_NOPROXY AND
+ NOT ("-noproxy" IN_LIST CMAKE_SWIG_FLAGS OR "-noproxy" IN_LIST SWIG_MODULE_${name}_EXTRA_FLAGS))
list (APPEND SWIG_MODULE_${name}_EXTRA_FLAGS "-noproxy")
endif()
if(SWIG_MODULE_${name}_LANGUAGE STREQUAL "UNKNOWN")
message(FATAL_ERROR "SWIG Error: Language \"${language}\" not found")
- elseif(SWIG_MODULE_${name}_LANGUAGE STREQUAL "PERL")
+ elseif(SWIG_MODULE_${name}_LANGUAGE STREQUAL "PERL" AND
+ NOT "-shadow" IN_LIST SWIG_MODULE_${name}_EXTRA_FLAGS)
list(APPEND SWIG_MODULE_${name}_EXTRA_FLAGS "-shadow")
endif()
endmacro()
@@ -294,7 +295,7 @@ function(SWIG_GET_EXTRA_OUTPUT_FILES language outfiles generatedpath infile)
endif()
foreach(it ${SWIG_${language}_EXTRA_FILE_EXTENSIONS})
set(extra_file "${generatedpath}/${module_basename}${it}")
- if (extra_file MATCHES "\\.cs$")
+ if (extra_file MATCHES "\\.cs$" AND CMAKE_CSharp_COMPILER_LOADED)
set_source_files_properties(${extra_file} PROPERTIES LANGUAGE "CSharp")
else()
# Treat extra outputs as plain files regardless of language.