diff --git a/Help/generator/Visual Studio 17 2022.rst b/Help/generator/Visual Studio 17 2022.rst index 708909ef9..b3f49f3df 100644 --- a/Help/generator/Visual Studio 17 2022.rst +++ b/Help/generator/Visual Studio 17 2022.rst @@ -5,11 +5,6 @@ Visual Studio 17 2022 Generates Visual Studio 17 (VS 2022) project files. -.. warning:: - - This is experimental and based on "Visual Studio 2022 Preview 4". - As of this version of CMake, VS 2022 has not been released. - Project Types ^^^^^^^^^^^^^ @@ -51,8 +46,8 @@ name (architecture). For example: Toolset Selection ^^^^^^^^^^^^^^^^^ -The ``v143`` toolset that comes with VS 17 2022 Preview 4 is selected by -default. The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps +The ``v143`` toolset that comes with VS 17 2022 is selected by default. +The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps via the :manual:`cmake(1)` ``-T`` option, to specify another toolset. .. |VS_TOOLSET_HOST_ARCH_DEFAULT| replace:: diff --git a/Help/release/3.21.rst b/Help/release/3.21.rst index a468817f0..e1c6172b2 100644 --- a/Help/release/3.21.rst +++ b/Help/release/3.21.rst @@ -26,9 +26,7 @@ Presets Generators ---------- -* The :generator:`Visual Studio 17 2022` generator was added. This is - experimental and based on "Visual Studio 2022 Preview 4" because this - version of VS has not been released. +* The :generator:`Visual Studio 17 2022` generator was added. * The :ref:`Makefile Generators` and the :generator:`Ninja` generator learned to add linker launcher tools along with the linker for ``C``, @@ -329,3 +327,10 @@ Changes made since CMake 3.21.0 include the following. * ``hipcc`` may once again be used as a ``CXX`` compiler, and is treated as whatever compiler it selects underneath, as CMake 3.20 and below did. + +3.21.4 +------ + +* The :generator:`Visual Studio 17 2022` generator is now based on the + "Visual Studio 2022" release candidates. Previously it was based on + preview versions. diff --git a/Modules/CMakeFindBinUtils.cmake b/Modules/CMakeFindBinUtils.cmake index 27d9131c8..8e9237a87 100644 --- a/Modules/CMakeFindBinUtils.cmake +++ b/Modules/CMakeFindBinUtils.cmake @@ -174,7 +174,10 @@ else() endif() list(PREPEND _CMAKE_AR_NAMES "llvm-ar") list(PREPEND _CMAKE_RANLIB_NAMES "llvm-ranlib") - list(PREPEND _CMAKE_STRIP_NAMES "llvm-strip") + if("${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_VERSION}" VERSION_GREATER_EQUAL 11) + # llvm-strip versions prior to 11 require additional flags we do not yet add. + list(PREPEND _CMAKE_STRIP_NAMES "llvm-strip") + endif() list(PREPEND _CMAKE_NM_NAMES "llvm-nm") if("${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_VERSION}" VERSION_GREATER_EQUAL 9) # llvm-objdump versions prior to 9 did not support everything we need. diff --git a/Modules/CPackIFW.cmake b/Modules/CPackIFW.cmake index 2087a518b..2e68770a5 100644 --- a/Modules/CPackIFW.cmake +++ b/Modules/CPackIFW.cmake @@ -439,6 +439,7 @@ set(_CPACK_IFW_PREFIXES "QtIFW-") set(_CPACK_IFW_VERSIONS + "4.1" "4.0" "3.2" "3.2.0" diff --git a/Modules/Compiler/MSVC-CXX.cmake b/Modules/Compiler/MSVC-CXX.cmake index f1c7450fa..5df5c1ebf 100644 --- a/Modules/Compiler/MSVC-CXX.cmake +++ b/Modules/Compiler/MSVC-CXX.cmake @@ -70,6 +70,7 @@ elseif (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0) cxx_std_14 cxx_std_17 cxx_std_20 + cxx_std_23 ) _record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES) endmacro() diff --git a/Modules/Compiler/NVHPC-C.cmake b/Modules/Compiler/NVHPC-C.cmake index e37aad562..9295abda8 100644 --- a/Modules/Compiler/NVHPC-C.cmake +++ b/Modules/Compiler/NVHPC-C.cmake @@ -9,4 +9,15 @@ if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 20.11) set(CMAKE_C17_EXTENSION_COMPILE_OPTION -std=gnu17) endif() +if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 21.07) + set(CMAKE_DEPFILE_FLAGS_C "-MD -MT -MF ") + set(CMAKE_C_DEPFILE_FORMAT gcc) + set(CMAKE_C_DEPENDS_USE_COMPILER TRUE) +else() + # Before NVHPC 21.07 the `-MD` flag implicitly + # implies `-E` and therefore compilation and dependency generation + # can't occur in the same invocation + set(CMAKE_C_DEPENDS_EXTRA_COMMANDS " -x c -M -MT -MD") +endif() + __compiler_nvhpc(C) diff --git a/Modules/Compiler/NVHPC-CXX.cmake b/Modules/Compiler/NVHPC-CXX.cmake index 534e82232..59ba7bfab 100644 --- a/Modules/Compiler/NVHPC-CXX.cmake +++ b/Modules/Compiler/NVHPC-CXX.cmake @@ -9,4 +9,14 @@ if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 20.11) set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION -std=gnu++20) endif() +if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 21.07) + set(CMAKE_DEPFILE_FLAGS_CXX "-MD -MT -MF ") + set(CMAKE_CXX_DEPFILE_FORMAT gcc) + set(CMAKE_CXX_DEPENDS_USE_COMPILER TRUE) +else() + # Before NVHPC 21.07 the `-MD` flag implicitly + # implies `-E` and therefore compilation and dependency generation + # can't occur in the same invocation + set(CMAKE_CXX_DEPENDS_EXTRA_COMMANDS " -x c++ -M -MT -MD") +endif() __compiler_nvhpc(CXX) diff --git a/Modules/Compiler/NVHPC.cmake b/Modules/Compiler/NVHPC.cmake index a85df711e..70486705c 100644 --- a/Modules/Compiler/NVHPC.cmake +++ b/Modules/Compiler/NVHPC.cmake @@ -12,16 +12,4 @@ include(Compiler/PGI) macro(__compiler_nvhpc lang) # Logic specific to NVHPC. - - if(CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 21.07) - set(CMAKE_DEPFILE_FLAGS_${lang} "-MD -MT -MF ") - set(CMAKE_${lang}_DEPFILE_FORMAT gcc) - set(CMAKE_${lang}_DEPENDS_USE_COMPILER TRUE) - else() - # Before NVHPC 21.07 the `-MD` flag implicitly - # implies `-E` and therefore compilation and dependency generation - # can't occur in the same invocation - set(CMAKE_${lang}_DEPENDS_EXTRA_COMMANDS " ${CMAKE_${lang}_COMPILE_OPTIONS_EXPLICIT_LANGUAGE} -M -MT -MD") - endif() - endmacro() diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake index c8df670b1..e7cd834d9 100644 --- a/Modules/FindMatlab.cmake +++ b/Modules/FindMatlab.cmake @@ -261,6 +261,7 @@ if(NOT MATLAB_ADDITIONAL_VERSIONS) endif() set(MATLAB_VERSIONS_MAPPING + "R2021b=9.11" "R2021a=9.10" "R2020b=9.9" "R2020a=9.8" diff --git a/Modules/FortranCInterface/Detect.cmake b/Modules/FortranCInterface/Detect.cmake index 9e5726b03..4d3cb005a 100644 --- a/Modules/FortranCInterface/Detect.cmake +++ b/Modules/FortranCInterface/Detect.cmake @@ -8,11 +8,10 @@ configure_file(${FortranCInterface_SOURCE_DIR}/Input.cmake.in # configuration changes. if(NOT EXISTS ${FortranCInterface_BINARY_DIR}/Output.cmake OR NOT EXISTS ${FortranCInterface_BINARY_DIR}/Input.cmake - OR NOT EXISTS ${FortranCInterface_BINARY_DIR}/Output.cmake.in OR NOT ${FortranCInterface_BINARY_DIR}/Output.cmake IS_NEWER_THAN ${FortranCInterface_BINARY_DIR}/Input.cmake OR NOT ${FortranCInterface_SOURCE_DIR}/Output.cmake - IS_NEWER_THAN ${FortranCInterface_BINARY_DIR}/Output.cmake.in + IS_NEWER_THAN ${FortranCInterface_SOURCE_DIR}/Output.cmake.in OR NOT ${FortranCInterface_BINARY_DIR}/Output.cmake IS_NEWER_THAN ${FortranCInterface_SOURCE_DIR}/CMakeLists.txt OR NOT ${FortranCInterface_BINARY_DIR}/Output.cmake diff --git a/Modules/GNUInstallDirs.cmake b/Modules/GNUInstallDirs.cmake index ead55ca1d..4aaad797b 100644 --- a/Modules/GNUInstallDirs.cmake +++ b/Modules/GNUInstallDirs.cmake @@ -180,6 +180,8 @@ _GNUInstallDirs_cache_path(CMAKE_INSTALL_BINDIR "bin" "User executables (bin)") _GNUInstallDirs_cache_path(CMAKE_INSTALL_SBINDIR "sbin" "System admin executables (sbin)") +_GNUInstallDirs_cache_path(CMAKE_INSTALL_LIBEXECDIR "libexec" + "Program executables (libexec)") _GNUInstallDirs_cache_path(CMAKE_INSTALL_SYSCONFDIR "etc" "Read-only single-machine data (etc)") _GNUInstallDirs_cache_path(CMAKE_INSTALL_SHAREDSTATEDIR "com" @@ -274,19 +276,6 @@ set(_GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" CACHE IN unset(_libdir_set) unset(__LAST_LIBDIR_DEFAULT) -if(CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$" - AND NOT CMAKE_CROSSCOMPILING - AND NOT EXISTS "/etc/arch-release" - AND EXISTS "/etc/debian_version" # is this a debian system ? - AND "${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/?$") - # see https://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.html#usrlibexec - # and https://www.debian.org/doc/debian-policy/ch-opersys#file-system-structure (section 9.1.1 bullet point 4) - _GNUInstallDirs_cache_path(CMAKE_INSTALL_LIBEXECDIR "${CMAKE_INSTALL_LIBDIR}" - "Program executables (${CMAKE_INSTALL_LIBDIR})") -else() - _GNUInstallDirs_cache_path(CMAKE_INSTALL_LIBEXECDIR "libexec" - "Program executables (libexec)") -endif() _GNUInstallDirs_cache_path(CMAKE_INSTALL_INCLUDEDIR "include" "C header files (include)") _GNUInstallDirs_cache_path(CMAKE_INSTALL_OLDINCLUDEDIR "/usr/include" diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake index 331623fa4..a2672784d 100644 --- a/Modules/InstallRequiredSystemLibraries.cmake +++ b/Modules/InstallRequiredSystemLibraries.cmake @@ -225,7 +225,7 @@ if(MSVC) elseif(MSVC_TOOLSET_VERSION GREATER_EQUAL 144) message(WARNING "MSVC toolset v${MSVC_TOOLSET_VERSION} not yet supported.") elseif(MSVC_TOOLSET_VERSION EQUAL 143) - set(MSVC_REDIST_NAME VC142) + set(MSVC_REDIST_NAME VC143) set(_MSVC_DLL_VERSION 140) set(_MSVC_IDE_VERSION 17) elseif(MSVC_TOOLSET_VERSION EQUAL 142) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 094b5aa01..3ca26b7e3 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 21) -set(CMake_VERSION_PATCH 3) +set(CMake_VERSION_PATCH 4) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) @@ -21,7 +21,7 @@ endif() if(NOT CMake_VERSION_NO_GIT) # If this source was exported by 'git archive', use its commit info. - set(git_info [==[7612abd52f CMake 3.21.3]==]) + set(git_info [==[f65cebf51a CMake 3.21.4]==]) # Otherwise, try to identify the current development source version. if(NOT git_info MATCHES "^([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]?[0-9a-f]?)[0-9a-f]* " diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index 006d66d3b..a1ebbdfb9 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -226,7 +226,7 @@ bool DebGenerator::generateDataTar() const cmCPackLogger(cmCPackLog::LOG_DEBUG, "RELATIVEDIR: \"" << relativeDir << "\"" << std::endl); -#ifdef WIN32 +#ifdef _WIN32 std::string mode_t_adt_filename = file + ":cmake_mode_t"; cmsys::ifstream permissionStream(mode_t_adt_filename.c_str()); diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx index a241a3a64..c6296f9f4 100644 --- a/Source/cmCommands.cxx +++ b/Source/cmCommands.cxx @@ -16,6 +16,7 @@ #include "cmAddTestCommand.h" #include "cmBreakCommand.h" #include "cmBuildCommand.h" +#include "cmCMakeLanguageCommand.h" #include "cmCMakeMinimumRequired.h" #include "cmCMakePathCommand.h" #include "cmCMakePolicyCommand.h" @@ -93,7 +94,6 @@ # include "cmAuxSourceDirectoryCommand.h" # include "cmBuildNameCommand.h" # include "cmCMakeHostSystemInformationCommand.h" -# include "cmCMakeLanguageCommand.h" # include "cmExportCommand.h" # include "cmExportLibraryDependenciesCommand.h" # include "cmFLTKWrapUICommand.h" @@ -128,6 +128,7 @@ void GetScriptingCommands(cmState* state) state->AddFlowControlCommand("return", cmReturnCommand); state->AddFlowControlCommand("while", cmWhileCommand); + state->AddBuiltinCommand("cmake_language", cmCMakeLanguageCommand); state->AddBuiltinCommand("cmake_minimum_required", cmCMakeMinimumRequired); state->AddBuiltinCommand("cmake_path", cmCMakePathCommand); state->AddBuiltinCommand("cmake_policy", cmCMakePolicyCommand); @@ -202,7 +203,6 @@ void GetScriptingCommands(cmState* state) #if !defined(CMAKE_BOOTSTRAP) state->AddBuiltinCommand("cmake_host_system_information", cmCMakeHostSystemInformationCommand); - state->AddBuiltinCommand("cmake_language", cmCMakeLanguageCommand); state->AddBuiltinCommand("load_cache", cmLoadCacheCommand); state->AddBuiltinCommand("remove", cmRemoveCommand); state->AddBuiltinCommand("variable_watch", cmVariableWatchCommand); diff --git a/Source/cmFileCopier.cxx b/Source/cmFileCopier.cxx index 48fc28682..237d234f8 100644 --- a/Source/cmFileCopier.cxx +++ b/Source/cmFileCopier.cxx @@ -72,7 +72,7 @@ bool cmFileCopier::SetPermissions(const std::string& toFile, mode_t permissions) { if (permissions) { -#ifdef WIN32 +#ifdef _WIN32 if (Makefile->IsOn("CMAKE_CROSSCOMPILING")) { // Store the mode in an NTFS alternate stream. std::string mode_t_adt_filename = toFile + ":cmake_mode_t"; diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index 7f7b1e7d7..e88f33c2f 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -88,7 +88,7 @@ void cmLocalNinjaGenerator::Generate() cmGlobalNinjaGenerator::WriteComment(this->GetRulesFileStream(), "localized /showIncludes string"); this->GetRulesFileStream() << "msvc_deps_prefix = "; -#ifdef WIN32 +#ifdef _WIN32 // Ninja uses the ANSI Windows APIs, so strings in the rules file // typically need to be ANSI encoded. However, in this case the compiler // is being invoked using the UTF-8 codepage so the /showIncludes prefix diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index 4dd78e514..4e3c58421 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -1306,7 +1306,16 @@ bool cmQtAutoGenInitializer::InitAutogenTarget() // Add additional autogen target dependencies to // '_autogen_timestamp_deps'. for (const cmTarget* t : this->AutogenTarget.DependTargets) { - dependencies.push_back(t->GetName()); + std::string depname = t->GetName(); + if (t->IsImported()) { + auto ttype = t->GetType(); + if (ttype == cmStateEnums::TargetType::STATIC_LIBRARY || + ttype == cmStateEnums::TargetType::SHARED_LIBRARY || + ttype == cmStateEnums::TargetType::UNKNOWN_LIBRARY) { + depname = cmStrCat("$GetName(), ">"); + } + } + dependencies.push_back(depname); } cmTarget* timestampTarget = this->LocalGen->AddUtilityCommand( diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 1f4c0b805..db45add4f 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -1461,7 +1461,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector const& args, cmSystemTools::Error("Problem extracting tar: " + outFile); return 1; } -#ifdef WIN32 +#ifdef _WIN32 // OK, on windows 7 after we untar some files, // sometimes we can not rename the directory after // the untar is done. This breaks the external project diff --git a/Templates/TestDriver.cxx.in b/Templates/TestDriver.cxx.in index 6ced8001c..632bb8065 100644 --- a/Templates/TestDriver.cxx.in +++ b/Templates/TestDriver.cxx.in @@ -138,7 +138,7 @@ int main(int ac, char* av[]) t = clock() - t; status_message = (status == -1) ? "not ok" : "ok"; { - double time_taken = ((double)t) / CLOCKS_PER_SEC; + double time_taken = CM_CAST(double, t) / CLOCKS_PER_SEC; printf("%s %d %s # %f\n", status_message, i + 1, name, time_taken); } } diff --git a/Tests/RunCMake/Autogen/CMP0111-imported-target-full.cmake b/Tests/RunCMake/Autogen/CMP0111-imported-target-full.cmake new file mode 100644 index 000000000..331da6453 --- /dev/null +++ b/Tests/RunCMake/Autogen/CMP0111-imported-target-full.cmake @@ -0,0 +1,12 @@ +include("${CMAKE_CURRENT_LIST_DIR}/CMP0111-imported-target-prelude.cmake") + +set_location(executable LOCATION "${CMAKE_CURRENT_BINARY_DIR}/executable${CMAKE_EXECUTABLE_SUFFIX}") + +set_location(shared LOCATION "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}shared${CMAKE_SHARED_LIBRARY_SUFFIX}") +if (CMAKE_IMPORT_LIBRARY_SUFFIX) + set_location(shared IMPLIB "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_IMPORT_LIBRARY_PREFIX}shared${CMAKE_IMPORT_LIBRARY_SUFFIX}") +endif () + +set_location(static LOCATION "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}static${CMAKE_STATIC_LIBRARY_SUFFIX}") +set_location(unknown LOCATION "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_IMPORT_LIBRARY_PREFIX}unknown${CMAKE_IMPORT_LIBRARY_SUFFIX}") +set_location(module LOCATION "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_SHARED_MODULE_PREFIX}module${CMAKE_SHARED_MODULE_SUFFIX}") diff --git a/Tests/RunCMake/Autogen/CMP0111-imported-target-implib-only.cmake b/Tests/RunCMake/Autogen/CMP0111-imported-target-implib-only.cmake new file mode 100644 index 000000000..8640fdc53 --- /dev/null +++ b/Tests/RunCMake/Autogen/CMP0111-imported-target-implib-only.cmake @@ -0,0 +1,13 @@ +include("${CMAKE_CURRENT_LIST_DIR}/CMP0111-imported-target-prelude.cmake") + +set_location(executable LOCATION "${CMAKE_CURRENT_BINARY_DIR}/executable${CMAKE_EXECUTABLE_SUFFIX}") + +if (CMAKE_IMPORT_LIBRARY_SUFFIX) + set_location(shared IMPLIB "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_IMPORT_LIBRARY_PREFIX}shared${CMAKE_IMPORT_LIBRARY_SUFFIX}") +else () + set_location(shared LOCATION "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}shared${CMAKE_SHARED_LIBRARY_SUFFIX}") +endif () + +set_location(static LOCATION "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}static${CMAKE_STATIC_LIBRARY_SUFFIX}") +set_location(unknown LOCATION "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}unknown${CMAKE_STATIC_LIBRARY_SUFFIX}") +set_location(module LOCATION "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_SHARED_MODULE_PREFIX}module${CMAKE_SHARED_MODULE_SUFFIX}") diff --git a/Tests/RunCMake/Autogen/CMP0111-imported-target-libname.cmake b/Tests/RunCMake/Autogen/CMP0111-imported-target-libname.cmake new file mode 100644 index 000000000..e1318c27e --- /dev/null +++ b/Tests/RunCMake/Autogen/CMP0111-imported-target-libname.cmake @@ -0,0 +1,14 @@ +include("${CMAKE_CURRENT_LIST_DIR}/CMP0111-imported-target-prelude.cmake") + +set_location(executable LOCATION "${CMAKE_CURRENT_BINARY_DIR}/executable${CMAKE_EXECUTABLE_SUFFIX}") + +set_location(shared LOCATION "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}shared${CMAKE_SHARED_LIBRARY_SUFFIX}") +if (CMAKE_IMPORT_LIBRARY_SUFFIX) + set_location(shared IMPLIB "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_IMPORT_LIBRARY_PREFIX}shared${CMAKE_IMPORT_LIBRARY_SUFFIX}") +endif () + +set_location(static LOCATION "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_IMPORT_LIBRARY_PREFIX}static${CMAKE_IMPORT_LIBRARY_SUFFIX}") +set_location(unknown LOCATION "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_IMPORT_LIBRARY_PREFIX}unknown${CMAKE_IMPORT_LIBRARY_SUFFIX}") +set_location(module LOCATION "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_SHARED_MODULE_PREFIX}module${CMAKE_SHARED_MODULE_SUFFIX}") + +set_location(interface LIBNAME "interface") diff --git a/Tests/RunCMake/Autogen/CMP0111-imported-target-prelude.cmake b/Tests/RunCMake/Autogen/CMP0111-imported-target-prelude.cmake new file mode 100644 index 000000000..8fa6041b9 --- /dev/null +++ b/Tests/RunCMake/Autogen/CMP0111-imported-target-prelude.cmake @@ -0,0 +1,32 @@ +enable_language(CXX) + +find_package(Qt5 REQUIRED COMPONENTS Core) + +# Detect `-NOTFOUND` libraries at generate time. +cmake_policy(SET CMP0111 NEW) + +add_executable(imported::executable IMPORTED) +add_library(imported::shared SHARED IMPORTED) +add_library(imported::static STATIC IMPORTED) +add_library(imported::unknown UNKNOWN IMPORTED) +add_library(imported::interface INTERFACE IMPORTED) +add_library(imported::module MODULE IMPORTED) + +function (set_location target name loc) + set_property(TARGET "imported::${target}" PROPERTY + "IMPORTED_${name}" "${loc}") +endfunction () + +set(CMAKE_AUTOMOC 1) + +add_library(automoc + empty.cpp) +target_link_libraries(automoc + PRIVATE + imported::shared + imported::static + imported::unknown + imported::interface) +add_dependencies(automoc + imported::executable + imported::module) diff --git a/Tests/RunCMake/Autogen/RunCMakeTest.cmake b/Tests/RunCMake/Autogen/RunCMakeTest.cmake index a31b67cd7..bbcbd5ed8 100644 --- a/Tests/RunCMake/Autogen/RunCMakeTest.cmake +++ b/Tests/RunCMake/Autogen/RunCMakeTest.cmake @@ -5,4 +5,8 @@ if (with_qt5) run_cmake(QtInFunction) run_cmake(QtInFunctionNested) run_cmake(QtInFunctionProperty) + + run_cmake(CMP0111-imported-target-full) + run_cmake(CMP0111-imported-target-libname) + run_cmake(CMP0111-imported-target-implib-only) endif () diff --git a/Tests/RunCMake/GNUInstallDirs/Usr-Debian-stderr.txt b/Tests/RunCMake/GNUInstallDirs/Usr-Debian-stderr.txt index 89578ee56..c38006c30 100644 --- a/Tests/RunCMake/GNUInstallDirs/Usr-Debian-stderr.txt +++ b/Tests/RunCMake/GNUInstallDirs/Usr-Debian-stderr.txt @@ -5,7 +5,7 @@ CMAKE_INSTALL_DOCDIR='share/doc/Usr' CMAKE_INSTALL_INCLUDEDIR='include' CMAKE_INSTALL_INFODIR='share/info' CMAKE_INSTALL_LIBDIR='lib/arch' -CMAKE_INSTALL_LIBEXECDIR='lib/arch' +CMAKE_INSTALL_LIBEXECDIR='libexec' CMAKE_INSTALL_LOCALEDIR='share/locale' CMAKE_INSTALL_LOCALSTATEDIR='var' CMAKE_INSTALL_RUNSTATEDIR='var/run' @@ -20,7 +20,7 @@ CMAKE_INSTALL_FULL_DOCDIR='/usr/share/doc/Usr' CMAKE_INSTALL_FULL_INCLUDEDIR='/usr/include' CMAKE_INSTALL_FULL_INFODIR='/usr/share/info' CMAKE_INSTALL_FULL_LIBDIR='/usr/lib/arch' -CMAKE_INSTALL_FULL_LIBEXECDIR='/usr/lib/arch' +CMAKE_INSTALL_FULL_LIBEXECDIR='/usr/libexec' CMAKE_INSTALL_FULL_LOCALEDIR='/usr/share/locale' CMAKE_INSTALL_FULL_LOCALSTATEDIR='/var' CMAKE_INSTALL_FULL_RUNSTATEDIR='/var/run' diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake index ed8e7258f..fa26c3d32 100644 --- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake +++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake @@ -91,7 +91,12 @@ function(XcodeSchemaGeneration) file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") run_cmake(XcodeSchemaGeneration) - run_cmake_command(XcodeSchemaGeneration-build xcodebuild -scheme foo build) + if (XCODE_VERSION VERSION_GREATER_EQUAL 13) + set(maybe_destination -destination platform=macOS) + else() + set(maybe_destination "") + endif() + run_cmake_command(XcodeSchemaGeneration-build xcodebuild -scheme foo ${maybe_destination} build) endfunction() if(NOT XCODE_VERSION VERSION_LESS 7) diff --git a/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombined-install-check.cmake b/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombined-install-check.cmake index a1c06718f..53b885d29 100644 --- a/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombined-install-check.cmake +++ b/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombined-install-check.cmake @@ -9,8 +9,8 @@ function(verify_architectures file) return() endif() - string(REGEX MATCHALL "architecture [^ \n\t]+" architectures ${otool_out}) - string(REPLACE "architecture " "" actual "${architectures}") + string(REGEX MATCHALL "\narchitecture [^ \n\t()]+" architectures ${otool_out}) + string(REPLACE "\narchitecture " "" actual "${architectures}") list(SORT actual) set(expected arm64 armv7 i386 x86_64) diff --git a/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedPrune-install-check.cmake b/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedPrune-install-check.cmake index 83da17da7..37bb4d594 100644 --- a/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedPrune-install-check.cmake +++ b/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedPrune-install-check.cmake @@ -9,8 +9,8 @@ function(verify_architectures file) return() endif() - string(REGEX MATCHALL "architecture [^ \n\t]+" architectures ${otool_out}) - string(REPLACE "architecture " "" actual "${architectures}") + string(REGEX MATCHALL "\narchitecture [^ \n\t()]+" architectures ${otool_out}) + string(REPLACE "\narchitecture " "" actual "${architectures}") list(SORT actual) set(expected armv7 x86_64) diff --git a/Utilities/cmzstd/lib/common/mem.h b/Utilities/cmzstd/lib/common/mem.h index 89c8aea7d..c3f98fcd0 100644 --- a/Utilities/cmzstd/lib/common/mem.h +++ b/Utilities/cmzstd/lib/common/mem.h @@ -173,9 +173,7 @@ void __asan_unpoison_memory_region(void const volatile *addr, size_t size); * Prefer these methods in priority order (0 > 1 > 2) */ #ifndef MEM_FORCE_MEMORY_ACCESS /* can be defined externally, on command line for example */ -# if defined(__GNUC__) && ( defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) ) -# define MEM_FORCE_MEMORY_ACCESS 2 -# elif defined(__INTEL_COMPILER) || defined(__GNUC__) || defined(__ICCARM__) +# if defined(__INTEL_COMPILER) || defined(__GNUC__) || defined(__ICCARM__) # define MEM_FORCE_MEMORY_ACCESS 1 # endif #endif diff --git a/Utilities/cmzstd/lib/common/xxhash.c b/Utilities/cmzstd/lib/common/xxhash.c index 597de18fc..3d7655eba 100644 --- a/Utilities/cmzstd/lib/common/xxhash.c +++ b/Utilities/cmzstd/lib/common/xxhash.c @@ -30,9 +30,7 @@ * Prefer these methods in priority order (0 > 1 > 2) */ #ifndef XXH_FORCE_MEMORY_ACCESS /* can be defined externally, on command line for example */ -# if defined(__GNUC__) && ( defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) ) -# define XXH_FORCE_MEMORY_ACCESS 2 -# elif (defined(__INTEL_COMPILER) && !defined(WIN32)) || \ +# if (defined(__INTEL_COMPILER) && !defined(WIN32)) || \ (defined(__GNUC__) && ( defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) )) || \ defined(__ICCARM__) # define XXH_FORCE_MEMORY_ACCESS 1 diff --git a/bootstrap b/bootstrap index dc5ed0b47..c7fbed11c 100755 --- a/bootstrap +++ b/bootstrap @@ -297,6 +297,7 @@ CMAKE_CXX_SOURCES="\ cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool \ cmBreakCommand \ cmBuildCommand \ + cmCMakeLanguageCommand \ cmCMakeMinimumRequired \ cmCMakePath \ cmCMakePathCommand \