summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:13:54 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:13:54 +0900
commita20e63ca854355e86691c077f4b404eedc43533f (patch)
treee931f968ee9503e64168d8a704eb59c32742d9ae
parentf894b5b1f451db3f47df77d333dab54b411cb12c (diff)
downloadcmake-a20e63ca854355e86691c077f4b404eedc43533f.tar.gz
cmake-a20e63ca854355e86691c077f4b404eedc43533f.tar.bz2
cmake-a20e63ca854355e86691c077f4b404eedc43533f.zip
Imported Upstream version 3.14.3upstream/3.14.3
-rw-r--r--Help/generator/Visual Studio 16 2019.rst3
-rw-r--r--Help/manual/cmake-variables.7.rst1
-rw-r--r--Help/release/3.14.rst11
-rw-r--r--Help/variable/CMAKE_VS_PLATFORM_NAME.rst4
-rw-r--r--Help/variable/CMAKE_VS_PLATFORM_NAME_DEFAULT.rst9
-rw-r--r--Modules/FindBoost.cmake27
-rw-r--r--Modules/FindOpenGL.cmake3
-rw-r--r--Modules/FindQt3.cmake12
-rw-r--r--Modules/InstallRequiredSystemLibraries.cmake7
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx2
-rw-r--r--Source/cmGlobalVisualStudioGenerator.cxx8
-rw-r--r--Source/cmGlobalVisualStudioGenerator.h3
-rw-r--r--Tests/FindBoost/CMakeLists.txt13
-rw-r--r--Tests/FindBoost/TestPython/CMakeLists.txt17
-rw-r--r--Tests/RunCMake/CTestCommandLine/show_only_json_check.pycbin1829 -> 1829 bytes
-rw-r--r--Tests/RunCMake/FileAPI/check_index.pycbin8146 -> 8146 bytes
-rw-r--r--Tests/RunCMake/GeneratorPlatform/TestPlatform-toolchain.cmake1
-rw-r--r--Tests/RunCMake/GeneratorPlatform/TestPlatformToolchain-stderr.txt1
19 files changed, 107 insertions, 17 deletions
diff --git a/Help/generator/Visual Studio 16 2019.rst b/Help/generator/Visual Studio 16 2019.rst
index b456554b9..4aec7f73c 100644
--- a/Help/generator/Visual Studio 16 2019.rst
+++ b/Help/generator/Visual Studio 16 2019.rst
@@ -28,7 +28,8 @@ by default.
Platform Selection
^^^^^^^^^^^^^^^^^^
-The default target platform name (architecture) is that of the host.
+The default target platform name (architecture) is that of the host
+and is provided in the :variable:`CMAKE_VS_PLATFORM_NAME_DEFAULT` variable.
The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
via the :manual:`cmake(1)` ``-A`` option, to specify a target platform
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index 6bb30cba3..5c494b890 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -105,6 +105,7 @@ Variables that Provide Information
/variable/CMAKE_VS_MSBUILD_COMMAND
/variable/CMAKE_VS_NsightTegra_VERSION
/variable/CMAKE_VS_PLATFORM_NAME
+ /variable/CMAKE_VS_PLATFORM_NAME_DEFAULT
/variable/CMAKE_VS_PLATFORM_TOOLSET
/variable/CMAKE_VS_PLATFORM_TOOLSET_CUDA
/variable/CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE
diff --git a/Help/release/3.14.rst b/Help/release/3.14.rst
index f2a91c614..c20830475 100644
--- a/Help/release/3.14.rst
+++ b/Help/release/3.14.rst
@@ -137,6 +137,10 @@ Variables
relocatable and reproducible builds that are invariant of the build
directory.
+* A :variable:`CMAKE_VS_PLATFORM_NAME_DEFAULT` variable was added for
+ :ref:`Visual Studio Generators` to report their default platform used
+ when :variable:`CMAKE_GENERATOR_PLATFORM` is not set explicitly.
+
Properties
----------
@@ -391,3 +395,10 @@ Changes made since CMake 3.14.0 include the following.
our conventions. 3.14.1 revises the module to use ``Fontconfig_*``
variable names. This is incompatible with 3.14.0 but since the
module is new in the 3.14 series usage should not yet be widespread.
+
+3.14.3
+------
+
+* The :variable:`CMAKE_VS_PLATFORM_NAME_DEFAULT` variable was added
+ to help toolchain files work with the :generator:`Visual Studio 16 2019`
+ generator where the default platform now depends on the host platform.
diff --git a/Help/variable/CMAKE_VS_PLATFORM_NAME.rst b/Help/variable/CMAKE_VS_PLATFORM_NAME.rst
index a532743fb..7a4642a31 100644
--- a/Help/variable/CMAKE_VS_PLATFORM_NAME.rst
+++ b/Help/variable/CMAKE_VS_PLATFORM_NAME.rst
@@ -1,8 +1,10 @@
CMAKE_VS_PLATFORM_NAME
----------------------
-Visual Studio target platform name.
+Visual Studio target platform name used by the current generator.
VS 8 and above allow project files to specify a target platform.
CMake provides the name of the chosen platform in this variable.
See the :variable:`CMAKE_GENERATOR_PLATFORM` variable for details.
+
+See also the :variable:`CMAKE_VS_PLATFORM_NAME_DEFAULT` variable.
diff --git a/Help/variable/CMAKE_VS_PLATFORM_NAME_DEFAULT.rst b/Help/variable/CMAKE_VS_PLATFORM_NAME_DEFAULT.rst
new file mode 100644
index 000000000..c18e6fd37
--- /dev/null
+++ b/Help/variable/CMAKE_VS_PLATFORM_NAME_DEFAULT.rst
@@ -0,0 +1,9 @@
+CMAKE_VS_PLATFORM_NAME_DEFAULT
+------------------------------
+
+Default for the Visual Studio target platform name for the current generator
+without considering the value of the :variable:`CMAKE_GENERATOR_PLATFORM`
+variable. For :ref:`Visual Studio Generators` for VS 2017 and below this is
+always ``Win32``. For VS 2019 and above this is based on the host platform.
+
+See also the :variable:`CMAKE_VS_PLATFORM_NAME` variable.
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index 7882c4bdf..b5cc4cfeb 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -466,8 +466,17 @@ function(_Boost_GUESS_COMPILER_PREFIX _ret)
elseif (GHSMULTI)
set(_boost_COMPILER "-ghs")
elseif("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC")
- if(MSVC_TOOLSET_VERSION GREATER_EQUAL 141)
- set(_boost_COMPILER "-vc141;-vc140")
+ if(MSVC_TOOLSET_VERSION GREATER_EQUAL 150)
+ # Not yet known.
+ set(_boost_COMPILER "")
+ elseif(MSVC_TOOLSET_VERSION GREATER_EQUAL 140)
+ # MSVC toolset 14.x versions are forward compatible.
+ set(_boost_COMPILER "")
+ foreach(v 9 8 7 6 5 4 3 2 1 0)
+ if(MSVC_TOOLSET_VERSION GREATER_EQUAL 14${v})
+ list(APPEND _boost_COMPILER "-vc14${v}")
+ endif()
+ endforeach()
elseif(MSVC_TOOLSET_VERSION GREATER_EQUAL 80)
set(_boost_COMPILER "-vc${MSVC_TOOLSET_VERSION}")
elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.10)
@@ -1077,9 +1086,15 @@ function(_Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS component
else()
set(_arch_suffix 32)
endif()
- if(MSVC_TOOLSET_VERSION GREATER_EQUAL 141)
- list(APPEND ${componentlibvar} ${basedir}/lib${_arch_suffix}-msvc-14.1)
- list(APPEND ${componentlibvar} ${basedir}/lib${_arch_suffix}-msvc-14.0)
+ if(MSVC_TOOLSET_VERSION GREATER_EQUAL 150)
+ # Not yet known.
+ elseif(MSVC_TOOLSET_VERSION GREATER_EQUAL 140)
+ # MSVC toolset 14.x versions are forward compatible.
+ foreach(v 9 8 7 6 5 4 3 2 1 0)
+ if(MSVC_TOOLSET_VERSION GREATER_EQUAL 14${v})
+ list(APPEND ${componentlibvar} ${basedir}/lib${_arch_suffix}-msvc-14.${v})
+ endif()
+ endforeach()
elseif(MSVC_TOOLSET_VERSION GREATER_EQUAL 80)
math(EXPR _toolset_major_version "${MSVC_TOOLSET_VERSION} / 10")
list(APPEND ${componentlibvar} ${basedir}/lib${_arch_suffix}-msvc-${_toolset_major_version}.0)
@@ -1756,7 +1771,7 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}${COMPONENT_PYTHON_VERSION_MAJOR}-py${COMPONENT_PYTHON_VERSION_MAJOR}${COMPONENT_PYTHON_VERSION_MINOR}")
list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}-py${COMPONENT_PYTHON_VERSION_MAJOR}${COMPONENT_PYTHON_VERSION_MINOR}")
# Gentoo
- list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}-${COMPONENT_PYTHON_VERSION_MAJOR}${COMPONENT_PYTHON_VERSION_MINOR}")
+ list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}-${COMPONENT_PYTHON_VERSION_MAJOR}.${COMPONENT_PYTHON_VERSION_MINOR}")
# RPMs
list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}-${COMPONENT_PYTHON_VERSION_MAJOR}${COMPONENT_PYTHON_VERSION_MINOR}")
endif()
diff --git a/Modules/FindOpenGL.cmake b/Modules/FindOpenGL.cmake
index 832dca274..00db033d3 100644
--- a/Modules/FindOpenGL.cmake
+++ b/Modules/FindOpenGL.cmake
@@ -205,11 +205,13 @@ else()
find_library(OPENGL_glx_LIBRARY
NAMES GLX
PATHS ${_OPENGL_LIB_PATH}
+ PATH_SUFFIXES libglvnd
)
find_library(OPENGL_egl_LIBRARY
NAMES EGL
PATHS ${_OPENGL_LIB_PATH}
+ PATH_SUFFIXES libglvnd
)
find_library(OPENGL_glu_LIBRARY
@@ -264,6 +266,7 @@ else()
/usr/openwin/lib
/usr/shlib
${_OPENGL_LIB_PATH}
+ PATH_SUFFIXES libglvnd
)
endif()
diff --git a/Modules/FindQt3.cmake b/Modules/FindQt3.cmake
index 4a8e28b1b..563ed46ec 100644
--- a/Modules/FindQt3.cmake
+++ b/Modules/FindQt3.cmake
@@ -101,7 +101,7 @@ if (QT_MT_REQUIRED)
/usr/share/qt3
C:/Progra~1/qt
PATH_SUFFIXES
- lib/qt lib/qt3 qt qt3 qt/lib qt3/lib
+ lib lib/qt lib/qt3 qt qt3 qt/lib qt3/lib
)
else ()
@@ -119,7 +119,7 @@ else ()
/usr/share/qt3
C:/Progra~1/qt/lib
PATH_SUFFIXES
- lib/qt lib/qt3 qt qt3 qt/lib qt3/lib
+ lib lib/qt lib/qt3 qt qt3 qt/lib qt3/lib
)
endif ()
@@ -135,7 +135,7 @@ find_library(QT_QASSISTANTCLIENT_LIBRARY
/usr/share/qt3
C:/Progra~1/qt
PATH_SUFFIXES
- lib/qt lib/qt3 qt qt3 qt/lib qt3/lib
+ lib lib/qt lib/qt3 qt qt3 qt/lib qt3/lib
)
# Qt 3 should prefer QTDIR over the PATH
@@ -151,7 +151,7 @@ find_program(QT_MOC_EXECUTABLE
/usr/share/qt3
C:/Progra~1/qt
PATH_SUFFIXES
- lib/qt lib/qt3 qt qt3 qt/lib qt3/lib
+ bin lib/qt lib/qt3 qt qt3 qt/bin qt3/bin lib/qt/bin lib/qt3/bin
)
if(QT_MOC_EXECUTABLE)
@@ -171,7 +171,7 @@ find_program(QT_UIC_EXECUTABLE
/usr/share/qt3
C:/Progra~1/qt
PATH_SUFFIXES
- lib/qt lib/qt3 qt qt3 qt/lib qt3/lib
+ bin lib/qt lib/qt3 qt qt3 qt/bin qt3/bin lib/qt/bin lib/qt3/bin
)
if(QT_UIC_EXECUTABLE)
@@ -188,6 +188,8 @@ if (WIN32)
PATHS
"$ENV{ProgramFiles}/qt"
"C:/Program Files/qt"
+ PATH_SUFFIXES
+ lib
DOC "This Library is only needed by and included with Qt3 on MSWindows. It should be NOTFOUND, undefined or IGNORE otherwise."
)
endif ()
diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake
index 2f34a7aa6..0a98895ce 100644
--- a/Modules/InstallRequiredSystemLibraries.cmake
+++ b/Modules/InstallRequiredSystemLibraries.cmake
@@ -213,10 +213,13 @@ if(MSVC)
elseif(MSVC_VERSION_VERSION GREATER_EQUAL 143)
message(WARNING "MSVC toolset v${MSVC_VERSION_VERSION} not yet supported.")
elseif(MSVC_TOOLSET_VERSION EQUAL 142)
- # FIXME: VS 2019 RC 4 uses VC141 but an update will fix it to be VC142.
- set(MSVC_REDIST_NAME VC141)
+ set(MSVC_REDIST_NAME VC142)
set(_MSVC_DLL_VERSION 140)
set(_MSVC_IDE_VERSION 16)
+ if(MSVC_VERSION EQUAL 1920)
+ # VS2019 named this differently prior to update 1.
+ set(MSVC_REDIST_NAME VC141)
+ endif()
elseif(MSVC_TOOLSET_VERSION EQUAL 141)
set(MSVC_REDIST_NAME VC141)
set(_MSVC_DLL_VERSION 140)
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 3beb8aff6..d77434526 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 14)
-set(CMake_VERSION_PATCH 2)
+set(CMake_VERSION_PATCH 3)
#set(CMake_VERSION_RC 0)
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index d457f60d1..d138c1e78 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -101,7 +101,7 @@ void cmGlobalVisualStudio7Generator::EnableLanguage(
}
// Create list of configurations requested by user's cache, if any.
- this->cmGlobalGenerator::EnableLanguage(lang, mf, optional);
+ this->cmGlobalVisualStudioGenerator::EnableLanguage(lang, mf, optional);
// if this environment variable is set, then copy it to
// a static cache entry. It will be used by
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index 639dc226d..f3ed76b61 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -52,6 +52,14 @@ void cmGlobalVisualStudioGenerator::SetVersion(VSVersion v)
this->Version = v;
}
+void cmGlobalVisualStudioGenerator::EnableLanguage(
+ std::vector<std::string> const& lang, cmMakefile* mf, bool optional)
+{
+ mf->AddDefinition("CMAKE_VS_PLATFORM_NAME_DEFAULT",
+ this->DefaultPlatformName.c_str());
+ this->cmGlobalGenerator::EnableLanguage(lang, mf, optional);
+}
+
bool cmGlobalVisualStudioGenerator::SetGeneratorPlatform(std::string const& p,
cmMakefile* mf)
{
diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h
index 039191c6c..cbab3294d 100644
--- a/Source/cmGlobalVisualStudioGenerator.h
+++ b/Source/cmGlobalVisualStudioGenerator.h
@@ -50,6 +50,9 @@ public:
/** Is the installed VS an Express edition? */
bool IsExpressEdition() const { return this->ExpressEdition; }
+ void EnableLanguage(std::vector<std::string> const& languages, cmMakefile*,
+ bool optional) override;
+
bool SetGeneratorPlatform(std::string const& p, cmMakefile* mf) override;
/**
diff --git a/Tests/FindBoost/CMakeLists.txt b/Tests/FindBoost/CMakeLists.txt
index 17a8ec700..58d795ba4 100644
--- a/Tests/FindBoost/CMakeLists.txt
+++ b/Tests/FindBoost/CMakeLists.txt
@@ -33,3 +33,16 @@ add_test(NAME FindBoost.TestHeaders COMMAND
--build-options ${build_options}
--test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
)
+
+if (CMake_TEST_FindBoost_Python)
+ add_test(NAME FindBoost.TestPython COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindBoost/TestPython"
+ "${CMake_BINARY_DIR}/Tests/FindBoost/TestPython"
+ ${build_generator_args}
+ --build-project TestFindBoostPython
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+endif ()
diff --git a/Tests/FindBoost/TestPython/CMakeLists.txt b/Tests/FindBoost/TestPython/CMakeLists.txt
new file mode 100644
index 000000000..4d137ca0d
--- /dev/null
+++ b/Tests/FindBoost/TestPython/CMakeLists.txt
@@ -0,0 +1,17 @@
+cmake_minimum_required(VERSION 3.14)
+project(TestFindBoostPython CXX)
+include(CTest)
+
+find_package(Boost OPTIONAL_COMPONENTS python27 python34 python35 python36 python37)
+
+set(FAILTEST TRUE)
+foreach (v IN ITEMS 27 34 35 36 37)
+ if (Boost_PYTHON${v}_FOUND)
+ set(FAILTEST FALSE)
+ break()
+ endif ()
+endforeach ()
+
+if (FAILTEST)
+ message(FATAL_ERROR "No Boost Python module found")
+endif ()
diff --git a/Tests/RunCMake/CTestCommandLine/show_only_json_check.pyc b/Tests/RunCMake/CTestCommandLine/show_only_json_check.pyc
index 5c7865a2c..7a757043e 100644
--- a/Tests/RunCMake/CTestCommandLine/show_only_json_check.pyc
+++ b/Tests/RunCMake/CTestCommandLine/show_only_json_check.pyc
Binary files differ
diff --git a/Tests/RunCMake/FileAPI/check_index.pyc b/Tests/RunCMake/FileAPI/check_index.pyc
index 95f7018e9..6c069b73b 100644
--- a/Tests/RunCMake/FileAPI/check_index.pyc
+++ b/Tests/RunCMake/FileAPI/check_index.pyc
Binary files differ
diff --git a/Tests/RunCMake/GeneratorPlatform/TestPlatform-toolchain.cmake b/Tests/RunCMake/GeneratorPlatform/TestPlatform-toolchain.cmake
index 763478cc5..d8138b8b2 100644
--- a/Tests/RunCMake/GeneratorPlatform/TestPlatform-toolchain.cmake
+++ b/Tests/RunCMake/GeneratorPlatform/TestPlatform-toolchain.cmake
@@ -1 +1,2 @@
+message("CMAKE_VS_PLATFORM_NAME_DEFAULT is \"${CMAKE_VS_PLATFORM_NAME_DEFAULT}\"")
set(CMAKE_GENERATOR_PLATFORM "Test Platform")
diff --git a/Tests/RunCMake/GeneratorPlatform/TestPlatformToolchain-stderr.txt b/Tests/RunCMake/GeneratorPlatform/TestPlatformToolchain-stderr.txt
index b9bb3b231..686779013 100644
--- a/Tests/RunCMake/GeneratorPlatform/TestPlatformToolchain-stderr.txt
+++ b/Tests/RunCMake/GeneratorPlatform/TestPlatformToolchain-stderr.txt
@@ -1,3 +1,4 @@
+CMAKE_VS_PLATFORM_NAME_DEFAULT is "[^"]+"
CMake Error at TestPlatformToolchain.cmake:[0-9]+ \(message\):
CMAKE_GENERATOR_PLATFORM is "Test Platform" as expected.
Call Stack \(most recent call first\):