diff options
333 files changed, 5395 insertions, 1677 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 297afda..d8806c3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -826,6 +826,15 @@ b:macos-arm64-ninja: variables: CMAKE_CI_JOB_CONTINUOUS: "true" +b:macos-arm64-pch: + extends: + - .macos_arm64_pch + - .cmake_build_macos + - .macos_arm64_tags + - .run_manually + variables: + CMAKE_CI_JOB_NIGHTLY: "true" + t:macos-x86_64-ninja: extends: - .macos_x86_64_ninja @@ -998,6 +1007,15 @@ b:windows-vs2022-x64-ninja: - .windows_x86_64_tags_nonconcurrent_vs2022 - .run_manually +b:windows-vs2022-x64-pch: + extends: + - .windows_vs2022_x64_pch + - .cmake_build_windows + - .windows_x86_64_tags_nonconcurrent_vs2022 + - .run_manually + variables: + CMAKE_CI_JOB_NIGHTLY: "true" + t:windows-vs2022-x64-ninja: extends: - .windows_vs2022_x64_ninja diff --git a/.gitlab/ci/configure_debian10_aarch64_ninja.cmake b/.gitlab/ci/configure_debian10_aarch64_ninja.cmake index dff0db1..91d4632 100644 --- a/.gitlab/ci/configure_debian10_aarch64_ninja.cmake +++ b/.gitlab/ci/configure_debian10_aarch64_ninja.cmake @@ -74,9 +74,12 @@ set(CMake_TEST_FindPNG "ON" CACHE BOOL "") set(CMake_TEST_FindPostgreSQL "ON" CACHE BOOL "") set(CMake_TEST_FindProtobuf "ON" CACHE BOOL "") set(CMake_TEST_FindProtobuf_gRPC "ON" CACHE BOOL "") -set(CMake_TEST_FindPython "ON" CACHE BOOL "") -set(CMake_TEST_FindPython_NumPy "ON" CACHE BOOL "") -set(CMake_TEST_FindPython_PyPy "ON" CACHE BOOL "") +set(CMake_TEST_FindPython2 "ON" CACHE BOOL "") +set(CMake_TEST_FindPython3 "ON" CACHE BOOL "") +set(CMake_TEST_FindPython2_NumPy "ON" CACHE BOOL "") +set(CMake_TEST_FindPython3_NumPy "ON" CACHE BOOL "") +set(CMake_TEST_FindPython2_PyPy "ON" CACHE BOOL "") +set(CMake_TEST_FindPython3_PyPy "ON" CACHE BOOL "") set(CMake_TEST_FindRuby "ON" CACHE BOOL "") set(CMake_TEST_FindSDL "ON" CACHE BOOL "") set(CMake_TEST_FindSQLite3 "ON" CACHE BOOL "") diff --git a/.gitlab/ci/configure_debian10_ninja.cmake b/.gitlab/ci/configure_debian10_ninja.cmake index 211a2a7..eca92bc 100644 --- a/.gitlab/ci/configure_debian10_ninja.cmake +++ b/.gitlab/ci/configure_debian10_ninja.cmake @@ -78,10 +78,13 @@ set(CMake_TEST_FindPNG "ON" CACHE BOOL "") set(CMake_TEST_FindPostgreSQL "ON" CACHE BOOL "") set(CMake_TEST_FindProtobuf "ON" CACHE BOOL "") set(CMake_TEST_FindProtobuf_gRPC "ON" CACHE BOOL "") -set(CMake_TEST_FindPython "ON" CACHE BOOL "") -set(CMake_TEST_FindPython_IronPython "ON" CACHE BOOL "") -set(CMake_TEST_FindPython_NumPy "ON" CACHE BOOL "") -set(CMake_TEST_FindPython_PyPy "ON" CACHE BOOL "") +set(CMake_TEST_FindPython2 "ON" CACHE BOOL "") +set(CMake_TEST_FindPython3 "ON" CACHE BOOL "") +set(CMake_TEST_FindPython2_IronPython "ON" CACHE BOOL "") +set(CMake_TEST_FindPython2_NumPy "ON" CACHE BOOL "") +set(CMake_TEST_FindPython2_NumPy "ON" CACHE BOOL "") +set(CMake_TEST_FindPython2_PyPy "ON" CACHE BOOL "") +set(CMake_TEST_FindPython3_PyPy "ON" CACHE BOOL "") set(CMake_TEST_FindRuby "ON" CACHE BOOL "") set(CMake_TEST_FindRuby_RVM "ON" CACHE BOOL "") set(CMake_TEST_FindSDL "ON" CACHE BOOL "") diff --git a/.gitlab/ci/configure_fedora38_makefiles.cmake b/.gitlab/ci/configure_fedora38_makefiles.cmake index c2f9982..a3881cf 100644 --- a/.gitlab/ci/configure_fedora38_makefiles.cmake +++ b/.gitlab/ci/configure_fedora38_makefiles.cmake @@ -74,9 +74,12 @@ set(CMake_TEST_FindPNG "ON" CACHE BOOL "") set(CMake_TEST_FindPostgreSQL "ON" CACHE BOOL "") set(CMake_TEST_FindProtobuf "ON" CACHE BOOL "") set(CMake_TEST_FindProtobuf_gRPC "ON" CACHE BOOL "") -set(CMake_TEST_FindPython "ON" CACHE BOOL "") -set(CMake_TEST_FindPython_NumPy "ON" CACHE BOOL "") -set(CMake_TEST_FindPython_PyPy "ON" CACHE BOOL "") +set(CMake_TEST_FindPython2 "ON" CACHE BOOL "") +set(CMake_TEST_FindPython3 "ON" CACHE BOOL "") +set(CMake_TEST_FindPython2_NumPy "ON" CACHE BOOL "") +set(CMake_TEST_FindPython3_NumPy "ON" CACHE BOOL "") +set(CMake_TEST_FindPython2_PyPy "ON" CACHE BOOL "") +set(CMake_TEST_FindPython3_PyPy "ON" CACHE BOOL "") set(CMake_TEST_FindRuby "ON" CACHE BOOL "") set(CMake_TEST_FindRuby_RVM "ON" CACHE BOOL "") set(CMake_TEST_FindSDL "ON" CACHE BOOL "") diff --git a/.gitlab/ci/configure_macos_arm64_ninja_multi.cmake b/.gitlab/ci/configure_macos_arm64_ninja_multi.cmake index b22285c..d81bd30 100644 --- a/.gitlab/ci/configure_macos_arm64_ninja_multi.cmake +++ b/.gitlab/ci/configure_macos_arm64_ninja_multi.cmake @@ -2,5 +2,9 @@ if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "") set(CMake_TEST_ISPC "ON" CACHE STRING "") endif() +# FIXME: sccache sometimes fails with "Compiler killed by signal 9". +# This job does not compile much anyway, so suppress it for now. +set(configure_no_sccache 1) + include("${CMAKE_CURRENT_LIST_DIR}/configure_macos_common.cmake") include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake") diff --git a/.gitlab/ci/configure_macos_arm64_pch.cmake b/.gitlab/ci/configure_macos_arm64_pch.cmake new file mode 100644 index 0000000..e2676ba --- /dev/null +++ b/.gitlab/ci/configure_macos_arm64_pch.cmake @@ -0,0 +1,7 @@ +set(CMake_BUILD_PCH "ON" CACHE BOOL "") + +# sccache does not forward the PCH '-Xarch_arm64 "-include/..."' flag correctly. +set(configure_no_sccache 1) + +include("${CMAKE_CURRENT_LIST_DIR}/configure_macos_common.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake") diff --git a/.gitlab/ci/configure_windows_vs2022_x64_pch.cmake b/.gitlab/ci/configure_windows_vs2022_x64_pch.cmake new file mode 100644 index 0000000..2a2eed7 --- /dev/null +++ b/.gitlab/ci/configure_windows_vs2022_x64_pch.cmake @@ -0,0 +1,2 @@ +set(CMake_BUILD_PCH "ON" CACHE BOOL "") +include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_common.cmake") diff --git a/.gitlab/ci/docker/debian10/deps_packages.lst b/.gitlab/ci/docker/debian10/deps_packages.lst index 0b79675..fc5c174 100644 --- a/.gitlab/ci/docker/debian10/deps_packages.lst +++ b/.gitlab/ci/docker/debian10/deps_packages.lst @@ -96,5 +96,5 @@ ruby ruby-dev swig unixodbc-dev -# CMake_TEST_FindPython_IronPython +# CMake_TEST_FindPython2_IronPython libmono-system-windows-forms4.0-cil diff --git a/.gitlab/ci/ispc.sh b/.gitlab/ci/ispc.sh index 59ee200..c1e3793 100755 --- a/.gitlab/ci/ispc.sh +++ b/.gitlab/ci/ispc.sh @@ -12,12 +12,12 @@ case "$(uname -s)-$(uname -m)" in ;; Darwin-arm64) shatool="shasum -a 256" - sha256sum="62cee043a3a4dbff8c2f6d3885a7e573901bbc1325dd93d50f92904b7ea67fec" + sha256sum="c423a5a88d7a9a6ed667e41d025801c123fa0c5fd384d4ea138fa1fcf2bc24c9" platform="macOS.arm64" ;; Darwin-x86_64) shatool="shasum -a 256" - sha256sum="da0f11a048a316081a8ad8170d48b170b2ed7efc3b140fc88b8611238809c8e4" + sha256sum="e25222d2d6f4f8e3561556ac73f88721ceb5486439d6c2a566d37407ad9a5907" platform="macOS.x86_64" ;; *) diff --git a/.gitlab/os-macos.yml b/.gitlab/os-macos.yml index 09d7598..fbba288 100644 --- a/.gitlab/os-macos.yml +++ b/.gitlab/os-macos.yml @@ -38,6 +38,12 @@ CMAKE_CONFIGURATION: macos_arm64_ninja CTEST_NO_WARNINGS_ALLOWED: 1 +.macos_arm64_pch: + extends: .macos_arm64_ninja + + variables: + CMAKE_CONFIGURATION: macos_arm64_pch + .macos_x86_64_makefiles: extends: .macos_build diff --git a/.gitlab/os-windows.yml b/.gitlab/os-windows.yml index 026f2f4..422e147 100644 --- a/.gitlab/os-windows.yml +++ b/.gitlab/os-windows.yml @@ -55,6 +55,13 @@ VCVARSPLATFORM: "arm64" VCVARSVERSION: "14.36.32532" +.windows_vs2022_x64_pch: + extends: + - .windows_vs2022_x64_ninja + + variables: + CMAKE_CONFIGURATION: windows_vs2022_x64_pch + .windows_vs2022_x64_ninja: extends: - .windows_build_ninja diff --git a/Auxiliary/vim/cmake.vim.in b/Auxiliary/vim/cmake.vim.in index 6edc040..39d7193 100644 --- a/Auxiliary/vim/cmake.vim.in +++ b/Auxiliary/vim/cmake.vim.in @@ -22,20 +22,20 @@ set cpo&vim syn region cmakeBracketArgument start="\[\z(=\?\|=[0-9]*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell syn region cmakeComment start="#" end="$" contains=cmakeTodo,@Spell -syn region cmakeBracketComment start="#\[\z(=\?\|=[0-9]*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell +syn region cmakeBracketComment start="\[\z(=*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell syn match cmakeEscaped /\(\\\\\|\\"\|\\n\|\\t\)/ contained syn region cmakeRegistry start="\[" end="]" contained oneline contains=cmakeTodo,cmakeEscaped syn region cmakeGeneratorExpression start="$<" end=">" contained oneline contains=cmakeVariableValue,cmakeProperty,cmakeGeneratorExpressions,cmakeTodo -syn region cmakeString start='"' end='"' contained contains=cmakeTodo,cmakeVariableValue,cmakeEscaped +syn region cmakeString start='"' end='"' contained contains=cmakeTodo,cmakeVariableValue,cmakeEscaped,@Spell syn region cmakeVariableValue start="${" end="}" contained oneline contains=cmakeVariable,cmakeTodo,cmakeVariableValue syn region cmakeEnvironment start="$ENV{" end="}" contained oneline contains=cmakeTodo -syn region cmakeArguments start="(" end=")" contains=ALLBUT,cmakeGeneratorExpressions,cmakeCommand,cmakeCommandConditional,cmakeCommandRepeat,cmakeCommandDeprecated,cmakeCommandManuallyAdded,cmakeArguments,cmakeTodo +syn region cmakeArguments start="(" end=")" contains=ALLBUT,cmakeGeneratorExpressions,cmakeCommand,cmakeCommandConditional,cmakeCommandRepeat,cmakeCommandDeprecated,cmakeCommandManuallyAdded,cmakeArguments,cmakeTodo,@Spell syn case match diff --git a/Auxiliary/vim/extract-upper-case.pl b/Auxiliary/vim/extract-upper-case.pl index 1179199..7f40b74 100755 --- a/Auxiliary/vim/extract-upper-case.pl +++ b/Auxiliary/vim/extract-upper-case.pl @@ -16,10 +16,10 @@ my @modules; my %keywords; # command => keyword-list # find cmake/Modules/ | sed -rn 's/.*CMakeDetermine(.+)Compiler.cmake/\1/p' | sort -my @languages = qw(ASM ASM_MASM ASM_NASM C CSharp CUDA CXX Fortran Java RC Swift); +my @languages = qw(ASM ASM_MASM ASM_NASM C CSharp CUDA CXX Fortran Java RC Swift HIP); # unwanted upper-cases -my %unwanted = map { $_ => 1 } qw(VS CXX IDE NOTFOUND NO_ DFOO DBAR NEW); +my %unwanted = map { $_ => 1 } qw(VS CXX IDE NOTFOUND NO_ DFOO DBAR NEW GNU); # cannot remove ALL - exists for add_custom_command # control-statements @@ -30,7 +30,7 @@ my %loop = map { $_ => 1 } qw(foreach while endforeach endwhile); my %deprecated = map { $_ => 1 } qw(build_name exec_program export_library_dependencies install_files install_programs install_targets link_libraries make_directory output_required_files remove subdir_depends subdirs use_mangled_mesa utility_source variable_requires write_file); # add some (popular) modules -push @modules, "ExternalProject"; +push @modules, "ExternalProject", "FetchContent"; # variables open(CMAKE, "$cmake --help-variable-list|") or die "could not run cmake"; diff --git a/Auxiliary/vim/syntax/cmake.vim b/Auxiliary/vim/syntax/cmake.vim index 83f13d8..82dc563 100644 --- a/Auxiliary/vim/syntax/cmake.vim +++ b/Auxiliary/vim/syntax/cmake.vim @@ -1,13 +1,13 @@ " Vim syntax file " Program: CMake - Cross-Platform Makefile Generator -" Version: cmake version 3.19.20201028-gdab947f +" Version: cmake version 3.27.20230713-gdc88dd5 " Language: CMake " Author: Andy Cedilnik <andy.cedilnik@kitware.com>, " Nicholas Hutchinson <nshutchinson@gmail.com>, " Patrick Boettcher <patrick.boettcher@posteo.de> " Maintainer: Dimitri Merejkowsky <d.merej@gmail.com> " Former Maintainer: Karthik Krishnan <karthik.krishnan@kitware.com> -" Last Change: 2020 oct. 28 +" Last Change: 2023 Jul 13 " " License: The CMake license applies to this file. See " https://cmake.org/licensing @@ -22,20 +22,20 @@ set cpo&vim syn region cmakeBracketArgument start="\[\z(=\?\|=[0-9]*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell syn region cmakeComment start="#" end="$" contains=cmakeTodo,@Spell -syn region cmakeBracketComment start="#\[\z(=\?\|=[0-9]*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell +syn region cmakeBracketComment start="\[\z(=*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell syn match cmakeEscaped /\(\\\\\|\\"\|\\n\|\\t\)/ contained syn region cmakeRegistry start="\[" end="]" contained oneline contains=cmakeTodo,cmakeEscaped syn region cmakeGeneratorExpression start="$<" end=">" contained oneline contains=cmakeVariableValue,cmakeProperty,cmakeGeneratorExpressions,cmakeTodo -syn region cmakeString start='"' end='"' contained contains=cmakeTodo,cmakeVariableValue,cmakeEscaped +syn region cmakeString start='"' end='"' contained contains=cmakeTodo,cmakeVariableValue,cmakeEscaped,@Spell syn region cmakeVariableValue start="${" end="}" contained oneline contains=cmakeVariable,cmakeTodo,cmakeVariableValue syn region cmakeEnvironment start="$ENV{" end="}" contained oneline contains=cmakeTodo -syn region cmakeArguments start="(" end=")" contains=ALLBUT,cmakeGeneratorExpressions,cmakeCommand,cmakeCommandConditional,cmakeCommandRepeat,cmakeCommandDeprecated,cmakeCommandManuallyAdded,cmakeArguments,cmakeTodo +syn region cmakeArguments start="(" end=")" contains=ALLBUT,cmakeGeneratorExpressions,cmakeCommand,cmakeCommandConditional,cmakeCommandRepeat,cmakeCommandDeprecated,cmakeCommandManuallyAdded,cmakeArguments,cmakeTodo,@Spell syn case match @@ -76,6 +76,7 @@ syn keyword cmakeProperty contained \ AUTOGEN_USE_SYSTEM_INCLUDE \ AUTOGEN_TARGETS_FOLDER \ AUTOGEN_TARGET_DEPENDS + \ AUTOGEN_USE_SYSTEM_INCLUDE \ AUTOMOC \ AUTOMOC_COMPILER_PREDEFINES \ AUTOMOC_DEPEND_FILTERS @@ -120,6 +121,7 @@ syn keyword cmakeProperty contained \ COMPILE_OPTIONS \ COMPILE_PDB_NAME \ COMPILE_PDB_OUTPUT_DIRECTORY + \ COMPILE_WARNING_AS_ERROR \ COST \ CPACK_DESKTOP_SHORTCUTS \ CPACK_NEVER_OVERWRITE @@ -140,6 +142,10 @@ syn keyword cmakeProperty contained \ CUDA_STANDARD \ CUDA_STANDARD_REQUIRED \ CXX_EXTENSIONS + \ CXX_MODULE_DIRS + \ CXX_MODULE_SET + \ CXX_MODULE_SETS + \ CXX_SCAN_FOR_MODULES \ CXX_STANDARD \ CXX_STANDARD_REQUIRED \ C_EXTENSIONS @@ -156,6 +162,7 @@ syn keyword cmakeProperty contained \ DISABLED \ DISABLED_FEATURES \ DISABLE_PRECOMPILE_HEADERS + \ DLL_NAME_WITH_SOVERSION \ DOTNET_SDK \ DOTNET_TARGET_FRAMEWORK \ DOTNET_TARGET_FRAMEWORK_VERSION @@ -168,7 +175,9 @@ syn keyword cmakeProperty contained \ ENVIRONMENT_MODIFICATION \ EXCLUDE_FROM_ALL \ EXCLUDE_FROM_DEFAULT_BUILD + \ EXPORT_COMPILE_COMMANDS \ EXPORT_NAME + \ EXPORT_NO_SYSTEM \ EXPORT_PROPERTIES \ EXTERNAL_OBJECT \ EchoString @@ -183,6 +192,7 @@ syn keyword cmakeProperty contained \ FOLDER \ FRAMEWORK \ FRAMEWORK_VERSION + \ Fortran_BUILDING_INSTRINSIC_MODULES \ Fortran_FORMAT \ Fortran_MODULE_DIRECTORY \ Fortran_PREPROCESS @@ -195,7 +205,10 @@ syn keyword cmakeProperty contained \ GLOBAL_DEPENDS_NO_CYCLES \ GNUtoMS \ HAS_CXX + \ HEADER_DIRS \ HEADER_FILE_ONLY + \ HEADER_SET + \ HEADER_SETS \ HELPSTRING \ HIP_ARCHITECTURES \ HIP_EXTENSIONS @@ -214,8 +227,10 @@ syn keyword cmakeProperty contained \ IMPORTED_LINK_INTERFACE_MULTIPLICITY \ IMPORTED_LOCATION \ IMPORTED_NO_SONAME + \ IMPORTED_NO_SYSTEM \ IMPORTED_OBJECTS \ IMPORTED_SONAME + \ IMPORTED_TARGETS \ IMPORT_PREFIX \ IMPORT_SUFFIX \ INCLUDE_DIRECTORIES @@ -224,15 +239,21 @@ syn keyword cmakeProperty contained \ INSTALL_REMOVE_ENVIRONMENT_RPATH \ INSTALL_RPATH \ INSTALL_RPATH_USE_LINK_PATH + \ INTERFACE_AUTOMOC_MACRO_NAMES \ INTERFACE_AUTOUIC_OPTIONS \ INTERFACE_AUTOMOC_MACRO_NAMES \ INTERFACE_COMPILE_DEFINITIONS \ INTERFACE_COMPILE_FEATURES \ INTERFACE_COMPILE_OPTIONS + \ INTERFACE_CXX_MODULE_SETS + \ INTERFACE_HEADER_SETS + \ INTERFACE_HEADER_SETS_TO_VERIFY \ INTERFACE_INCLUDE_DIRECTORIES \ INTERFACE_LINK_DEPENDS \ INTERFACE_LINK_DIRECTORIES \ INTERFACE_LINK_LIBRARIES + \ INTERFACE_LINK_LIBRARIES_DIRECT + \ INTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE \ INTERFACE_LINK_OPTIONS \ INTERFACE_POSITION_INDEPENDENT_CODE \ INTERFACE_PRECOMPILE_HEADERS @@ -242,6 +263,7 @@ syn keyword cmakeProperty contained \ IN_TRY_COMPILE \ IOS_INSTALL_COMBINED \ ISPC_HEADER_DIRECTORY + \ ISPC_HEADER_SUFFIX \ ISPC_INSTRUCTION_SETS \ JOB_POOLS \ JOB_POOL_COMPILE @@ -260,6 +282,8 @@ syn keyword cmakeProperty contained \ LINK_INTERFACE_LIBRARIES \ LINK_INTERFACE_MULTIPLICITY \ LINK_LIBRARIES + \ LINK_LIBRARIES_ONLY_TARGETS + \ LINK_LIBRARY_OVERRIDE \ LINK_OPTIONS \ LINK_SEARCH_END_STATIC \ LINK_SEARCH_START_STATIC @@ -277,6 +301,7 @@ syn keyword cmakeProperty contained \ MANUALLY_ADDED_DEPENDENCIES \ MEASUREMENT \ MODIFIED + \ MSVC_DEBUG_INFORMATION_FORMAT \ MSVC_RUNTIME_LIBRARY \ NAME \ NO_SONAME @@ -343,6 +368,7 @@ syn keyword cmakeProperty contained \ SUBDIRECTORIES \ SUFFIX \ SYMBOLIC + \ SYSTEM \ Swift_DEPENDENCIES_FILE \ Swift_DIAGNOSTICS_FILE \ Swift_LANGUAGE_VERSION @@ -356,16 +382,20 @@ syn keyword cmakeProperty contained \ TEST_INCLUDE_FILES \ TIMEOUT \ TIMEOUT_AFTER_MATCH + \ TIMEOUT_SIGNAL_GRACE_PERIOD + \ TIMEOUT_SIGNAL_NAME \ TYPE \ UNITY_BUILD \ UNITY_BUILD_BATCH_SIZE \ UNITY_BUILD_CODE_AFTER_INCLUDE \ UNITY_BUILD_CODE_BEFORE_INCLUDE \ UNITY_BUILD_MODE + \ UNITY_BUILD_UNIQUE_ID \ UNITY_GROUP \ USE_FOLDERS \ VALUE \ VARIABLES + \ VERIFY_INTERFACE_HEADER_SETS \ VERSION \ VISIBILITY_INLINES_HIDDEN \ VS_CONFIGURATION_TYPE @@ -422,11 +452,14 @@ syn keyword cmakeProperty contained \ VS_WINRT_EXTENSIONS \ VS_WINRT_REFERENCES \ VS_XAML_TYPE + \ WATCOM_RUNTIME_LIBRARY \ WILL_FAIL \ WIN32_EXECUTABLE \ WINDOWS_EXPORT_ALL_SYMBOLS \ WORKING_DIRECTORY \ WRAP_EXCLUDE + \ XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY + \ XCODE_EMBED_FRAMEWORKS_REMOVE_HEADERS_ON_COPY \ XCODE_EMIT_EFFECTIVE_PLATFORM_NAME \ XCODE_EXPLICIT_FILE_TYPE \ XCODE_FILE_ATTRIBUTES @@ -443,9 +476,13 @@ syn keyword cmakeProperty contained \ XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER \ XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS \ XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE + \ XCODE_SCHEME_ENABLE_GPU_API_VALIDATION + \ XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE + \ XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION \ XCODE_SCHEME_ENVIRONMENT \ XCODE_SCHEME_EXECUTABLE \ XCODE_SCHEME_GUARD_MALLOC + \ XCODE_SCHEME_LAUNCH_CONFIGURATION \ XCODE_SCHEME_LAUNCH_MODE \ XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP \ XCODE_SCHEME_MALLOC_GUARD_EDGES @@ -460,16 +497,19 @@ syn keyword cmakeProperty contained \ XCODE_SCHEME_LAUNCH_CONFIGURATION \ XCODE_SCHEME_WORKING_DIRECTORY \ XCODE_SCHEME_ZOMBIE_OBJECTS + \ XCODE_XCCONFIG \ XCTEST syn keyword cmakeVariable contained \ ANDROID \ APPLE \ BORLAND + \ BSD \ BUILD_SHARED_LIBS \ CACHE \ CMAKE_ABSOLUTE_DESTINATION_FILES \ CMAKE_ADD_CUSTOM_COMMAND_DEPENDS_EXPLICIT_ONLY + \ CMAKE_ADSP_ROOT \ CMAKE_AIX_EXPORT_ALL_SYMBOLS \ CMAKE_ANDROID_ANT_ADDITIONAL_OPTIONS \ CMAKE_ANDROID_API @@ -479,6 +519,7 @@ syn keyword cmakeVariable contained \ CMAKE_ANDROID_ARM_MODE \ CMAKE_ANDROID_ARM_NEON \ CMAKE_ANDROID_ASSETS_DIRECTORIES + \ CMAKE_ANDROID_EXCEPTIONS \ CMAKE_ANDROID_GUI \ CMAKE_ANDROID_JAR_DEPENDENCIES \ CMAKE_ANDROID_JAR_DIRECTORIES @@ -489,14 +530,17 @@ syn keyword cmakeVariable contained \ CMAKE_ANDROID_NDK_DEPRECATED_HEADERS \ CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG \ CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION + \ CMAKE_ANDROID_NDK_VERSION \ CMAKE_ANDROID_PROCESS_MAX \ CMAKE_ANDROID_PROGUARD \ CMAKE_ANDROID_PROGUARD_CONFIG_PATH + \ CMAKE_ANDROID_RTTI \ CMAKE_ANDROID_SECURE_PROPS_PATH \ CMAKE_ANDROID_SKIP_ANT_STEP \ CMAKE_ANDROID_STANDALONE_TOOLCHAIN \ CMAKE_ANDROID_STL_TYPE \ CMAKE_APPBUNDLE_PATH + \ CMAKE_APPLE_SILICON_PROCESSOR \ CMAKE_AR \ CMAKE_ARCHIVE_OUTPUT_DIRECTORY \ CMAKE_ARGC @@ -508,12 +552,15 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_ARCHIVE_APPEND \ CMAKE_ASM_ARCHIVE_CREATE \ CMAKE_ASM_ARCHIVE_FINISH + \ CMAKE_ASM_BYTE_ORDER \ CMAKE_ASM_CLANG_TIDY + \ CMAKE_ASM_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_ASM_COMPILER \ CMAKE_ASM_COMPILER_ABI \ CMAKE_ASM_COMPILER_AR \ CMAKE_ASM_COMPILER_ARCHITECTURE_ID \ CMAKE_ASM_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_ASM_COMPILER_FRONTEND_VARIANT \ CMAKE_ASM_COMPILER_ID \ CMAKE_ASM_COMPILER_LAUNCHER \ CMAKE_ASM_COMPILER_LOADED @@ -528,6 +575,8 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_CREATE_SHARED_LIBRARY \ CMAKE_ASM_CREATE_SHARED_MODULE \ CMAKE_ASM_CREATE_STATIC_LIBRARY + \ CMAKE_ASM_EXTENSIONS + \ CMAKE_ASM_EXTENSIONS_DEFAULT \ CMAKE_ASM_FLAGS \ CMAKE_ASM_FLAGS_DEBUG \ CMAKE_ASM_FLAGS_DEBUG_INIT @@ -546,6 +595,7 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_INCLUDE_WHAT_YOU_USE \ CMAKE_ASM_INIT \ CMAKE_ASM_LIBRARY_ARCHITECTURE + \ CMAKE_ASM_LINKER_LAUNCHER \ CMAKE_ASM_LINKER_PREFERENCE \ CMAKE_ASM_LINKER_PREFERENCE_PROPAGATES \ CMAKE_ASM_LINKER_WRAPPER_FLAG @@ -554,6 +604,7 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_LINK_LIBRARY_FILE_FLAG \ CMAKE_ASM_LINK_LIBRARY_FLAG \ CMAKE_ASM_LINK_LIBRARY_SUFFIX + \ CMAKE_ASM_LINK_WHAT_YOU_USE_FLAG \ CMAKE_ASM_MASM \ CMAKE_ASM_MASM_ANDROID_TOOLCHAIN_MACHINE \ CMAKE_ASM_MASM_ANDROID_TOOLCHAIN_PREFIX @@ -561,12 +612,15 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_MASM_ARCHIVE_APPEND \ CMAKE_ASM_MASM_ARCHIVE_CREATE \ CMAKE_ASM_MASM_ARCHIVE_FINISH + \ CMAKE_ASM_MASM_BYTE_ORDER \ CMAKE_ASM_MASM_CLANG_TIDY + \ CMAKE_ASM_MASM_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_ASM_MASM_COMPILER \ CMAKE_ASM_MASM_COMPILER_ABI \ CMAKE_ASM_MASM_COMPILER_AR \ CMAKE_ASM_MASM_COMPILER_ARCHITECTURE_ID \ CMAKE_ASM_MASM_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_ASM_MASM_COMPILER_FRONTEND_VARIANT \ CMAKE_ASM_MASM_COMPILER_ID \ CMAKE_ASM_MASM_COMPILER_LAUNCHER \ CMAKE_ASM_MASM_COMPILER_LOADED @@ -581,6 +635,8 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_MASM_CREATE_SHARED_LIBRARY \ CMAKE_ASM_MASM_CREATE_SHARED_MODULE \ CMAKE_ASM_MASM_CREATE_STATIC_LIBRARY + \ CMAKE_ASM_MASM_EXTENSIONS + \ CMAKE_ASM_MASM_EXTENSIONS_DEFAULT \ CMAKE_ASM_MASM_FLAGS \ CMAKE_ASM_MASM_FLAGS_DEBUG \ CMAKE_ASM_MASM_FLAGS_DEBUG_INIT @@ -599,6 +655,7 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_MASM_INCLUDE_WHAT_YOU_USE \ CMAKE_ASM_MASM_INIT \ CMAKE_ASM_MASM_LIBRARY_ARCHITECTURE + \ CMAKE_ASM_MASM_LINKER_LAUNCHER \ CMAKE_ASM_MASM_LINKER_PREFERENCE \ CMAKE_ASM_MASM_LINKER_PREFERENCE_PROPAGATES \ CMAKE_ASM_MASM_LINKER_WRAPPER_FLAG @@ -607,14 +664,19 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_MASM_LINK_LIBRARY_FILE_FLAG \ CMAKE_ASM_MASM_LINK_LIBRARY_FLAG \ CMAKE_ASM_MASM_LINK_LIBRARY_SUFFIX + \ CMAKE_ASM_MASM_LINK_WHAT_YOU_USE_FLAG \ CMAKE_ASM_MASM_OUTPUT_EXTENSION \ CMAKE_ASM_MASM_PLATFORM_ID \ CMAKE_ASM_MASM_SIMULATE_ID \ CMAKE_ASM_MASM_SIMULATE_VERSION \ CMAKE_ASM_MASM_SIZEOF_DATA_PTR \ CMAKE_ASM_MASM_SOURCE_FILE_EXTENSIONS + \ CMAKE_ASM_MASM_STANDARD + \ CMAKE_ASM_MASM_STANDARD_DEFAULT \ CMAKE_ASM_MASM_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_ASM_MASM_STANDARD_LIBRARIES + \ CMAKE_ASM_MASM_STANDARD_REQUIRED + \ CMAKE_ASM_MASM_SUPPORTED \ CMAKE_ASM_MASM_VISIBILITY_PRESET \ CMAKE_ASM_NASM \ CMAKE_ASM_NASM_ANDROID_TOOLCHAIN_MACHINE @@ -623,12 +685,15 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_NASM_ARCHIVE_APPEND \ CMAKE_ASM_NASM_ARCHIVE_CREATE \ CMAKE_ASM_NASM_ARCHIVE_FINISH + \ CMAKE_ASM_NASM_BYTE_ORDER \ CMAKE_ASM_NASM_CLANG_TIDY + \ CMAKE_ASM_NASM_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_ASM_NASM_COMPILER \ CMAKE_ASM_NASM_COMPILER_ABI \ CMAKE_ASM_NASM_COMPILER_AR \ CMAKE_ASM_NASM_COMPILER_ARCHITECTURE_ID \ CMAKE_ASM_NASM_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_ASM_NASM_COMPILER_FRONTEND_VARIANT \ CMAKE_ASM_NASM_COMPILER_ID \ CMAKE_ASM_NASM_COMPILER_LAUNCHER \ CMAKE_ASM_NASM_COMPILER_LOADED @@ -643,6 +708,8 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_NASM_CREATE_SHARED_LIBRARY \ CMAKE_ASM_NASM_CREATE_SHARED_MODULE \ CMAKE_ASM_NASM_CREATE_STATIC_LIBRARY + \ CMAKE_ASM_NASM_EXTENSIONS + \ CMAKE_ASM_NASM_EXTENSIONS_DEFAULT \ CMAKE_ASM_NASM_FLAGS \ CMAKE_ASM_NASM_FLAGS_DEBUG \ CMAKE_ASM_NASM_FLAGS_DEBUG_INIT @@ -661,6 +728,7 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_NASM_INCLUDE_WHAT_YOU_USE \ CMAKE_ASM_NASM_INIT \ CMAKE_ASM_NASM_LIBRARY_ARCHITECTURE + \ CMAKE_ASM_NASM_LINKER_LAUNCHER \ CMAKE_ASM_NASM_LINKER_PREFERENCE \ CMAKE_ASM_NASM_LINKER_PREFERENCE_PROPAGATES \ CMAKE_ASM_NASM_LINKER_WRAPPER_FLAG @@ -669,14 +737,19 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_NASM_LINK_LIBRARY_FILE_FLAG \ CMAKE_ASM_NASM_LINK_LIBRARY_FLAG \ CMAKE_ASM_NASM_LINK_LIBRARY_SUFFIX + \ CMAKE_ASM_NASM_LINK_WHAT_YOU_USE_FLAG \ CMAKE_ASM_NASM_OUTPUT_EXTENSION \ CMAKE_ASM_NASM_PLATFORM_ID \ CMAKE_ASM_NASM_SIMULATE_ID \ CMAKE_ASM_NASM_SIMULATE_VERSION \ CMAKE_ASM_NASM_SIZEOF_DATA_PTR \ CMAKE_ASM_NASM_SOURCE_FILE_EXTENSIONS + \ CMAKE_ASM_NASM_STANDARD + \ CMAKE_ASM_NASM_STANDARD_DEFAULT \ CMAKE_ASM_NASM_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_ASM_NASM_STANDARD_LIBRARIES + \ CMAKE_ASM_NASM_STANDARD_REQUIRED + \ CMAKE_ASM_NASM_SUPPORTED \ CMAKE_ASM_NASM_VISIBILITY_PRESET \ CMAKE_ASM_OUTPUT_EXTENSION \ CMAKE_ASM_PLATFORM_ID @@ -684,8 +757,12 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_SIMULATE_VERSION \ CMAKE_ASM_SIZEOF_DATA_PTR \ CMAKE_ASM_SOURCE_FILE_EXTENSIONS + \ CMAKE_ASM_STANDARD + \ CMAKE_ASM_STANDARD_DEFAULT \ CMAKE_ASM_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_ASM_STANDARD_LIBRARIES + \ CMAKE_ASM_STANDARD_REQUIRED + \ CMAKE_ASM_SUPPORTED \ CMAKE_ASM_VISIBILITY_PRESET \ CMAKE_AUTOGEN_ORIGIN_DEPENDS \ CMAKE_AUTOGEN_PARALLEL @@ -694,15 +771,18 @@ syn keyword cmakeVariable contained \ CMAKE_AUTOMOC \ CMAKE_AUTOMOC_COMPILER_PREDEFINES \ CMAKE_AUTOMOC_DEPEND_FILTERS + \ CMAKE_AUTOMOC_EXECUTABLE \ CMAKE_AUTOMOC_MACRO_NAMES \ CMAKE_AUTOMOC_MOC_OPTIONS \ CMAKE_AUTOMOC_PATH_PREFIX \ CMAKE_AUTOMOC_RELAXED_MODE \ CMAKE_AUTOMOC_EXECUTABLE \ CMAKE_AUTORCC + \ CMAKE_AUTORCC_EXECUTABLE \ CMAKE_AUTORCC_OPTIONS \ CMAKE_AUTORCC_EXECUTABLE \ CMAKE_AUTOUIC + \ CMAKE_AUTOUIC_EXECUTABLE \ CMAKE_AUTOUIC_OPTIONS \ CMAKE_AUTOUIC_SEARCH_PATHS \ CMAKE_AUTOUIC_EXECUTABLE @@ -733,6 +813,7 @@ syn keyword cmakeVariable contained \ CMAKE_COMPILER_IS_GNUCXX \ CMAKE_COMPILER_IS_GNUG77 \ CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY + \ CMAKE_COMPILE_WARNING_AS_ERROR \ CMAKE_CONFIGURATION_TYPES \ CMAKE_CPACK_COMMAND \ CMAKE_CROSSCOMPILING @@ -745,12 +826,15 @@ syn keyword cmakeVariable contained \ CMAKE_CSharp_ARCHIVE_APPEND \ CMAKE_CSharp_ARCHIVE_CREATE \ CMAKE_CSharp_ARCHIVE_FINISH + \ CMAKE_CSharp_BYTE_ORDER \ CMAKE_CSharp_CLANG_TIDY + \ CMAKE_CSharp_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_CSharp_COMPILER \ CMAKE_CSharp_COMPILER_ABI \ CMAKE_CSharp_COMPILER_AR \ CMAKE_CSharp_COMPILER_ARCHITECTURE_ID \ CMAKE_CSharp_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_CSharp_COMPILER_FRONTEND_VARIANT \ CMAKE_CSharp_COMPILER_ID \ CMAKE_CSharp_COMPILER_LAUNCHER \ CMAKE_CSharp_COMPILER_LOADED @@ -765,6 +849,8 @@ syn keyword cmakeVariable contained \ CMAKE_CSharp_CREATE_SHARED_LIBRARY \ CMAKE_CSharp_CREATE_SHARED_MODULE \ CMAKE_CSharp_CREATE_STATIC_LIBRARY + \ CMAKE_CSharp_EXTENSIONS + \ CMAKE_CSharp_EXTENSIONS_DEFAULT \ CMAKE_CSharp_FLAGS \ CMAKE_CSharp_FLAGS_DEBUG \ CMAKE_CSharp_FLAGS_DEBUG_INIT @@ -783,6 +869,7 @@ syn keyword cmakeVariable contained \ CMAKE_CSharp_INCLUDE_WHAT_YOU_USE \ CMAKE_CSharp_INIT \ CMAKE_CSharp_LIBRARY_ARCHITECTURE + \ CMAKE_CSharp_LINKER_LAUNCHER \ CMAKE_CSharp_LINKER_PREFERENCE \ CMAKE_CSharp_LINKER_PREFERENCE_PROPAGATES \ CMAKE_CSharp_LINKER_WRAPPER_FLAG @@ -791,14 +878,19 @@ syn keyword cmakeVariable contained \ CMAKE_CSharp_LINK_LIBRARY_FILE_FLAG \ CMAKE_CSharp_LINK_LIBRARY_FLAG \ CMAKE_CSharp_LINK_LIBRARY_SUFFIX + \ CMAKE_CSharp_LINK_WHAT_YOU_USE_FLAG \ CMAKE_CSharp_OUTPUT_EXTENSION \ CMAKE_CSharp_PLATFORM_ID \ CMAKE_CSharp_SIMULATE_ID \ CMAKE_CSharp_SIMULATE_VERSION \ CMAKE_CSharp_SIZEOF_DATA_PTR \ CMAKE_CSharp_SOURCE_FILE_EXTENSIONS + \ CMAKE_CSharp_STANDARD + \ CMAKE_CSharp_STANDARD_DEFAULT \ CMAKE_CSharp_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_CSharp_STANDARD_LIBRARIES + \ CMAKE_CSharp_STANDARD_REQUIRED + \ CMAKE_CSharp_SUPPORTED \ CMAKE_CSharp_VISIBILITY_PRESET \ CMAKE_CTEST_ARGUMENTS \ CMAKE_CTEST_COMMAND @@ -810,12 +902,15 @@ syn keyword cmakeVariable contained \ CMAKE_CUDA_ARCHIVE_APPEND \ CMAKE_CUDA_ARCHIVE_CREATE \ CMAKE_CUDA_ARCHIVE_FINISH + \ CMAKE_CUDA_BYTE_ORDER \ CMAKE_CUDA_CLANG_TIDY + \ CMAKE_CUDA_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_CUDA_COMPILER \ CMAKE_CUDA_COMPILER_ABI \ CMAKE_CUDA_COMPILER_AR \ CMAKE_CUDA_COMPILER_ARCHITECTURE_ID \ CMAKE_CUDA_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_CUDA_COMPILER_FRONTEND_VARIANT \ CMAKE_CUDA_COMPILER_ID \ CMAKE_CUDA_COMPILER_LAUNCHER \ CMAKE_CUDA_COMPILER_LOADED @@ -832,6 +927,7 @@ syn keyword cmakeVariable contained \ CMAKE_CUDA_CREATE_SHARED_MODULE \ CMAKE_CUDA_CREATE_STATIC_LIBRARY \ CMAKE_CUDA_EXTENSIONS + \ CMAKE_CUDA_EXTENSIONS_DEFAULT \ CMAKE_CUDA_FLAGS \ CMAKE_CUDA_FLAGS_DEBUG \ CMAKE_CUDA_FLAGS_DEBUG_INIT @@ -851,6 +947,7 @@ syn keyword cmakeVariable contained \ CMAKE_CUDA_INCLUDE_WHAT_YOU_USE \ CMAKE_CUDA_INIT \ CMAKE_CUDA_LIBRARY_ARCHITECTURE + \ CMAKE_CUDA_LINKER_LAUNCHER \ CMAKE_CUDA_LINKER_PREFERENCE \ CMAKE_CUDA_LINKER_PREFERENCE_PROPAGATES \ CMAKE_CUDA_LINKER_WRAPPER_FLAG @@ -859,6 +956,7 @@ syn keyword cmakeVariable contained \ CMAKE_CUDA_LINK_LIBRARY_FILE_FLAG \ CMAKE_CUDA_LINK_LIBRARY_FLAG \ CMAKE_CUDA_LINK_LIBRARY_SUFFIX + \ CMAKE_CUDA_LINK_WHAT_YOU_USE_FLAG \ CMAKE_CUDA_OUTPUT_EXTENSION \ CMAKE_CUDA_PLATFORM_ID \ CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS @@ -869,9 +967,11 @@ syn keyword cmakeVariable contained \ CMAKE_CUDA_SIZEOF_DATA_PTR \ CMAKE_CUDA_SOURCE_FILE_EXTENSIONS \ CMAKE_CUDA_STANDARD + \ CMAKE_CUDA_STANDARD_DEFAULT \ CMAKE_CUDA_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_CUDA_STANDARD_LIBRARIES \ CMAKE_CUDA_STANDARD_REQUIRED + \ CMAKE_CUDA_SUPPORTED \ CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES \ CMAKE_CUDA_VISIBILITY_PRESET \ CMAKE_CURRENT_BINARY_DIR @@ -890,12 +990,15 @@ syn keyword cmakeVariable contained \ CMAKE_CXX_ARCHIVE_APPEND \ CMAKE_CXX_ARCHIVE_CREATE \ CMAKE_CXX_ARCHIVE_FINISH + \ CMAKE_CXX_BYTE_ORDER \ CMAKE_CXX_CLANG_TIDY + \ CMAKE_CXX_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_CXX_COMPILER \ CMAKE_CXX_COMPILER_ABI \ CMAKE_CXX_COMPILER_AR \ CMAKE_CXX_COMPILER_ARCHITECTURE_ID \ CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_CXX_COMPILER_FRONTEND_VARIANT \ CMAKE_CXX_COMPILER_ID \ CMAKE_CXX_COMPILER_LAUNCHER \ CMAKE_CXX_COMPILER_LOADED @@ -912,6 +1015,7 @@ syn keyword cmakeVariable contained \ CMAKE_CXX_CREATE_SHARED_MODULE \ CMAKE_CXX_CREATE_STATIC_LIBRARY \ CMAKE_CXX_EXTENSIONS + \ CMAKE_CXX_EXTENSIONS_DEFAULT \ CMAKE_CXX_FLAGS \ CMAKE_CXX_FLAGS_DEBUG \ CMAKE_CXX_FLAGS_DEBUG_INIT @@ -939,16 +1043,20 @@ syn keyword cmakeVariable contained \ CMAKE_CXX_LINK_LIBRARY_FILE_FLAG \ CMAKE_CXX_LINK_LIBRARY_FLAG \ CMAKE_CXX_LINK_LIBRARY_SUFFIX + \ CMAKE_CXX_LINK_WHAT_YOU_USE_FLAG \ CMAKE_CXX_OUTPUT_EXTENSION \ CMAKE_CXX_PLATFORM_ID + \ CMAKE_CXX_SCAN_FOR_MODULES \ CMAKE_CXX_SIMULATE_ID \ CMAKE_CXX_SIMULATE_VERSION \ CMAKE_CXX_SIZEOF_DATA_PTR \ CMAKE_CXX_SOURCE_FILE_EXTENSIONS \ CMAKE_CXX_STANDARD + \ CMAKE_CXX_STANDARD_DEFAULT \ CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_CXX_STANDARD_LIBRARIES \ CMAKE_CXX_STANDARD_REQUIRED + \ CMAKE_CXX_SUPPORTED \ CMAKE_CXX_VISIBILITY_PRESET \ CMAKE_C_ANDROID_TOOLCHAIN_MACHINE \ CMAKE_C_ANDROID_TOOLCHAIN_PREFIX @@ -956,12 +1064,15 @@ syn keyword cmakeVariable contained \ CMAKE_C_ARCHIVE_APPEND \ CMAKE_C_ARCHIVE_CREATE \ CMAKE_C_ARCHIVE_FINISH + \ CMAKE_C_BYTE_ORDER \ CMAKE_C_CLANG_TIDY + \ CMAKE_C_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_C_COMPILER \ CMAKE_C_COMPILER_ABI \ CMAKE_C_COMPILER_AR \ CMAKE_C_COMPILER_ARCHITECTURE_ID \ CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_C_COMPILER_FRONTEND_VARIANT \ CMAKE_C_COMPILER_ID \ CMAKE_C_COMPILER_LAUNCHER \ CMAKE_C_COMPILER_LOADED @@ -978,6 +1089,7 @@ syn keyword cmakeVariable contained \ CMAKE_C_CREATE_SHARED_MODULE \ CMAKE_C_CREATE_STATIC_LIBRARY \ CMAKE_C_EXTENSIONS + \ CMAKE_C_EXTENSIONS_DEFAULT \ CMAKE_C_FLAGS \ CMAKE_C_FLAGS_DEBUG \ CMAKE_C_FLAGS_DEBUG_INIT @@ -1005,6 +1117,7 @@ syn keyword cmakeVariable contained \ CMAKE_C_LINK_LIBRARY_FILE_FLAG \ CMAKE_C_LINK_LIBRARY_FLAG \ CMAKE_C_LINK_LIBRARY_SUFFIX + \ CMAKE_C_LINK_WHAT_YOU_USE_FLAG \ CMAKE_C_OUTPUT_EXTENSION \ CMAKE_C_PLATFORM_ID \ CMAKE_C_SIMULATE_ID @@ -1012,17 +1125,21 @@ syn keyword cmakeVariable contained \ CMAKE_C_SIZEOF_DATA_PTR \ CMAKE_C_SOURCE_FILE_EXTENSIONS \ CMAKE_C_STANDARD + \ CMAKE_C_STANDARD_DEFAULT \ CMAKE_C_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_C_STANDARD_LIBRARIES \ CMAKE_C_STANDARD_REQUIRED + \ CMAKE_C_SUPPORTED \ CMAKE_C_VISIBILITY_PRESET \ CMAKE_DEBUG_POSTFIX \ CMAKE_DEBUG_TARGET_PROPERTIES \ CMAKE_DEFAULT_BUILD_TYPE \ CMAKE_DEFAULT_CONFIGS \ CMAKE_DEPENDS_IN_PROJECT_ONLY + \ CMAKE_DEPENDS_USE_COMPILER \ CMAKE_DIRECTORY_LABELS \ CMAKE_DISABLE_PRECOMPILE_HEADERS + \ CMAKE_DLL_NAME_WITH_SOVERSION \ CMAKE_DL_LIBS \ CMAKE_DOTNET_SDK \ CMAKE_DOTNET_TARGET_FRAMEWORK @@ -1036,7 +1153,20 @@ syn keyword cmakeVariable contained \ CMAKE_ENABLE_EXPORTS \ CMAKE_ERROR_DEPRECATED \ CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION + \ CMAKE_EXECUTABLE_ENABLE_EXPORTS \ CMAKE_EXECUTABLE_SUFFIX + \ CMAKE_EXECUTABLE_SUFFIX_ASM + \ CMAKE_EXECUTABLE_SUFFIX_ASM_MASM + \ CMAKE_EXECUTABLE_SUFFIX_ASM_NASM + \ CMAKE_EXECUTABLE_SUFFIX_C + \ CMAKE_EXECUTABLE_SUFFIX_CSharp + \ CMAKE_EXECUTABLE_SUFFIX_CUDA + \ CMAKE_EXECUTABLE_SUFFIX_CXX + \ CMAKE_EXECUTABLE_SUFFIX_Fortran + \ CMAKE_EXECUTABLE_SUFFIX_HIP + \ CMAKE_EXECUTABLE_SUFFIX_Java + \ CMAKE_EXECUTABLE_SUFFIX_RC + \ CMAKE_EXECUTABLE_SUFFIX_Swift \ CMAKE_EXECUTE_PROCESS_COMMAND_ECHO \ CMAKE_EXE_LINKER_FLAGS \ CMAKE_EXE_LINKER_FLAGS_INIT @@ -1056,9 +1186,11 @@ syn keyword cmakeVariable contained \ CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY \ CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY \ CMAKE_FIND_PACKAGE_PREFER_CONFIG + \ CMAKE_FIND_PACKAGE_REDIRECTS_DIR \ CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS \ CMAKE_FIND_PACKAGE_SORT_DIRECTION \ CMAKE_FIND_PACKAGE_SORT_ORDER + \ CMAKE_FIND_PACKAGE_TARGETS_GLOBAL \ CMAKE_FIND_PACKAGE_WARN_NO_MODULE \ CMAKE_FIND_ROOT_PATH \ CMAKE_FIND_ROOT_PATH_MODE_INCLUDE @@ -1069,6 +1201,7 @@ syn keyword cmakeVariable contained \ CMAKE_FIND_USE_INSTALL_PREFIX \ CMAKE_FIND_USE_CMAKE_PATH \ CMAKE_FIND_USE_CMAKE_SYSTEM_PATH + \ CMAKE_FIND_USE_INSTALL_PREFIX \ CMAKE_FIND_USE_PACKAGE_REGISTRY \ CMAKE_FIND_USE_PACKAGE_ROOT_PATH \ CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH @@ -1083,12 +1216,15 @@ syn keyword cmakeVariable contained \ CMAKE_Fortran_ARCHIVE_APPEND \ CMAKE_Fortran_ARCHIVE_CREATE \ CMAKE_Fortran_ARCHIVE_FINISH + \ CMAKE_Fortran_BYTE_ORDER \ CMAKE_Fortran_CLANG_TIDY + \ CMAKE_Fortran_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_Fortran_COMPILER \ CMAKE_Fortran_COMPILER_ABI \ CMAKE_Fortran_COMPILER_AR \ CMAKE_Fortran_COMPILER_ARCHITECTURE_ID \ CMAKE_Fortran_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_Fortran_COMPILER_FRONTEND_VARIANT \ CMAKE_Fortran_COMPILER_ID \ CMAKE_Fortran_COMPILER_LAUNCHER \ CMAKE_Fortran_COMPILER_LOADED @@ -1103,6 +1239,8 @@ syn keyword cmakeVariable contained \ CMAKE_Fortran_CREATE_SHARED_LIBRARY \ CMAKE_Fortran_CREATE_SHARED_MODULE \ CMAKE_Fortran_CREATE_STATIC_LIBRARY + \ CMAKE_Fortran_EXTENSIONS + \ CMAKE_Fortran_EXTENSIONS_DEFAULT \ CMAKE_Fortran_FLAGS \ CMAKE_Fortran_FLAGS_DEBUG \ CMAKE_Fortran_FLAGS_DEBUG_INIT @@ -1122,6 +1260,7 @@ syn keyword cmakeVariable contained \ CMAKE_Fortran_INCLUDE_WHAT_YOU_USE \ CMAKE_Fortran_INIT \ CMAKE_Fortran_LIBRARY_ARCHITECTURE + \ CMAKE_Fortran_LINKER_LAUNCHER \ CMAKE_Fortran_LINKER_PREFERENCE \ CMAKE_Fortran_LINKER_PREFERENCE_PROPAGATES \ CMAKE_Fortran_LINKER_WRAPPER_FLAG @@ -1130,6 +1269,7 @@ syn keyword cmakeVariable contained \ CMAKE_Fortran_LINK_LIBRARY_FILE_FLAG \ CMAKE_Fortran_LINK_LIBRARY_FLAG \ CMAKE_Fortran_LINK_LIBRARY_SUFFIX + \ CMAKE_Fortran_LINK_WHAT_YOU_USE_FLAG \ CMAKE_Fortran_MODDIR_DEFAULT \ CMAKE_Fortran_MODDIR_FLAG \ CMAKE_Fortran_MODOUT_FLAG @@ -1141,8 +1281,12 @@ syn keyword cmakeVariable contained \ CMAKE_Fortran_SIMULATE_VERSION \ CMAKE_Fortran_SIZEOF_DATA_PTR \ CMAKE_Fortran_SOURCE_FILE_EXTENSIONS + \ CMAKE_Fortran_STANDARD + \ CMAKE_Fortran_STANDARD_DEFAULT \ CMAKE_Fortran_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_Fortran_STANDARD_LIBRARIES + \ CMAKE_Fortran_STANDARD_REQUIRED + \ CMAKE_Fortran_SUPPORTED \ CMAKE_Fortran_VISIBILITY_PRESET \ CMAKE_GENERATOR \ CMAKE_GENERATOR_INSTANCE @@ -1162,12 +1306,15 @@ syn keyword cmakeVariable contained \ CMAKE_HIP_ARCHIVE_APPEND \ CMAKE_HIP_ARCHIVE_CREATE \ CMAKE_HIP_ARCHIVE_FINISH + \ CMAKE_HIP_BYTE_ORDER \ CMAKE_HIP_CLANG_TIDY + \ CMAKE_HIP_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_HIP_COMPILER \ CMAKE_HIP_COMPILER_ABI \ CMAKE_HIP_COMPILER_AR \ CMAKE_HIP_COMPILER_ARCHITECTURE_ID \ CMAKE_HIP_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_HIP_COMPILER_FRONTEND_VARIANT \ CMAKE_HIP_COMPILER_ID \ CMAKE_HIP_COMPILER_LAUNCHER \ CMAKE_HIP_COMPILER_LOADED @@ -1184,6 +1331,7 @@ syn keyword cmakeVariable contained \ CMAKE_HIP_CREATE_SHARED_MODULE \ CMAKE_HIP_CREATE_STATIC_LIBRARY \ CMAKE_HIP_EXTENSIONS + \ CMAKE_HIP_EXTENSIONS_DEFAULT \ CMAKE_HIP_FLAGS \ CMAKE_HIP_FLAGS_DEBUG \ CMAKE_HIP_FLAGS_DEBUG_INIT @@ -1211,6 +1359,7 @@ syn keyword cmakeVariable contained \ CMAKE_HIP_LINK_LIBRARY_FILE_FLAG \ CMAKE_HIP_LINK_LIBRARY_FLAG \ CMAKE_HIP_LINK_LIBRARY_SUFFIX + \ CMAKE_HIP_LINK_WHAT_YOU_USE_FLAG \ CMAKE_HIP_OUTPUT_EXTENSION \ CMAKE_HIP_PLATFORM_ID \ CMAKE_HIP_SIMULATE_ID @@ -1218,12 +1367,16 @@ syn keyword cmakeVariable contained \ CMAKE_HIP_SIZEOF_DATA_PTR \ CMAKE_HIP_SOURCE_FILE_EXTENSIONS \ CMAKE_HIP_STANDARD + \ CMAKE_HIP_STANDARD_DEFAULT \ CMAKE_HIP_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_HIP_STANDARD_LIBRARIES \ CMAKE_HIP_STANDARD_REQUIRED + \ CMAKE_HIP_SUPPORTED \ CMAKE_HIP_VISIBILITY_PRESET \ CMAKE_HOME_DIRECTORY \ CMAKE_HOST_APPLE + \ CMAKE_HOST_BSD + \ CMAKE_HOST_LINUX \ CMAKE_HOST_SOLARIS \ CMAKE_HOST_SYSTEM \ CMAKE_HOST_SYSTEM_NAME @@ -1232,6 +1385,7 @@ syn keyword cmakeVariable contained \ CMAKE_HOST_UNIX \ CMAKE_HOST_WIN32 \ CMAKE_IGNORE_PATH + \ CMAKE_IGNORE_PREFIX_PATH \ CMAKE_IMPORT_LIBRARY_PREFIX \ CMAKE_IMPORT_LIBRARY_SUFFIX \ CMAKE_INCLUDE_CURRENT_DIR @@ -1252,6 +1406,7 @@ syn keyword cmakeVariable contained \ CMAKE_INTERPROCEDURAL_OPTIMIZATION \ CMAKE_IOS_INSTALL_COMBINED \ CMAKE_ISPC_HEADER_DIRECTORY + \ CMAKE_ISPC_HEADER_SUFFIX \ CMAKE_ISPC_INSTRUCTION_SETS \ CMAKE_JOB_POOLS \ CMAKE_JOB_POOL_COMPILE @@ -1264,12 +1419,15 @@ syn keyword cmakeVariable contained \ CMAKE_Java_ARCHIVE_APPEND \ CMAKE_Java_ARCHIVE_CREATE \ CMAKE_Java_ARCHIVE_FINISH + \ CMAKE_Java_BYTE_ORDER \ CMAKE_Java_CLANG_TIDY + \ CMAKE_Java_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_Java_COMPILER \ CMAKE_Java_COMPILER_ABI \ CMAKE_Java_COMPILER_AR \ CMAKE_Java_COMPILER_ARCHITECTURE_ID \ CMAKE_Java_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_Java_COMPILER_FRONTEND_VARIANT \ CMAKE_Java_COMPILER_ID \ CMAKE_Java_COMPILER_LAUNCHER \ CMAKE_Java_COMPILER_LOADED @@ -1284,6 +1442,8 @@ syn keyword cmakeVariable contained \ CMAKE_Java_CREATE_SHARED_LIBRARY \ CMAKE_Java_CREATE_SHARED_MODULE \ CMAKE_Java_CREATE_STATIC_LIBRARY + \ CMAKE_Java_EXTENSIONS + \ CMAKE_Java_EXTENSIONS_DEFAULT \ CMAKE_Java_FLAGS \ CMAKE_Java_FLAGS_DEBUG \ CMAKE_Java_FLAGS_DEBUG_INIT @@ -1302,6 +1462,7 @@ syn keyword cmakeVariable contained \ CMAKE_Java_INCLUDE_WHAT_YOU_USE \ CMAKE_Java_INIT \ CMAKE_Java_LIBRARY_ARCHITECTURE + \ CMAKE_Java_LINKER_LAUNCHER \ CMAKE_Java_LINKER_PREFERENCE \ CMAKE_Java_LINKER_PREFERENCE_PROPAGATES \ CMAKE_Java_LINKER_WRAPPER_FLAG @@ -1310,15 +1471,22 @@ syn keyword cmakeVariable contained \ CMAKE_Java_LINK_LIBRARY_FILE_FLAG \ CMAKE_Java_LINK_LIBRARY_FLAG \ CMAKE_Java_LINK_LIBRARY_SUFFIX + \ CMAKE_Java_LINK_WHAT_YOU_USE_FLAG \ CMAKE_Java_OUTPUT_EXTENSION \ CMAKE_Java_PLATFORM_ID \ CMAKE_Java_SIMULATE_ID \ CMAKE_Java_SIMULATE_VERSION \ CMAKE_Java_SIZEOF_DATA_PTR \ CMAKE_Java_SOURCE_FILE_EXTENSIONS + \ CMAKE_Java_STANDARD + \ CMAKE_Java_STANDARD_DEFAULT \ CMAKE_Java_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_Java_STANDARD_LIBRARIES + \ CMAKE_Java_STANDARD_REQUIRED + \ CMAKE_Java_SUPPORTED \ CMAKE_Java_VISIBILITY_PRESET + \ CMAKE_KATE_FILES_MODE + \ CMAKE_KATE_MAKE_ARGUMENTS \ CMAKE_LIBRARY_ARCHITECTURE \ CMAKE_LIBRARY_ARCHITECTURE_REGEX \ CMAKE_LIBRARY_OUTPUT_DIRECTORY @@ -1326,14 +1494,17 @@ syn keyword cmakeVariable contained \ CMAKE_LIBRARY_PATH_FLAG \ CMAKE_LINK_DEF_FILE_FLAG \ CMAKE_LINK_DEPENDS_NO_SHARED + \ CMAKE_LINK_DEPENDS_USE_LINKER \ CMAKE_LINK_DIRECTORIES_BEFORE \ CMAKE_LINK_INTERFACE_LIBRARIES + \ CMAKE_LINK_LIBRARIES_ONLY_TARGETS \ CMAKE_LINK_LIBRARY_FILE_FLAG \ CMAKE_LINK_LIBRARY_FLAG \ CMAKE_LINK_LIBRARY_SUFFIX \ CMAKE_LINK_SEARCH_END_STATIC \ CMAKE_LINK_SEARCH_START_STATIC \ CMAKE_LINK_WHAT_YOU_USE + \ CMAKE_LINK_WHAT_YOU_USE_CHECK \ CMAKE_MACOSX_BUNDLE \ CMAKE_MACOSX_RPATH \ CMAKE_MAJOR_VERSION @@ -1351,6 +1522,7 @@ syn keyword cmakeVariable contained \ CMAKE_MODULE_LINKER_FLAGS_INIT \ CMAKE_MODULE_PATH \ CMAKE_MSVCIDE_RUN_PATH + \ CMAKE_MSVC_DEBUG_INFORMATION_FORMAT \ CMAKE_MSVC_RUNTIME_LIBRARY \ CMAKE_NETRC \ CMAKE_NETRC_FILE @@ -1378,6 +1550,7 @@ syn keyword cmakeVariable contained \ CMAKE_PCH_INSTANTIATE_TEMPLATES \ CMAKE_PCH_WARN_INVALID \ CMAKE_PDB_OUTPUT_DIRECTORY + \ CMAKE_PLATFORM_NO_VERSIONED_SONAME \ CMAKE_POSITION_INDEPENDENT_CODE \ CMAKE_PREFIX_PATH \ CMAKE_PROGRAM_PATH @@ -1386,6 +1559,7 @@ syn keyword cmakeVariable contained \ CMAKE_PROJECT_INCLUDE \ CMAKE_PROJECT_INCLUDE_BEFORE \ CMAKE_PROJECT_NAME + \ CMAKE_PROJECT_TOP_LEVEL_INCLUDES \ CMAKE_PROJECT_VERSION \ CMAKE_PROJECT_VERSION_MAJOR \ CMAKE_PROJECT_VERSION_MINOR @@ -1399,12 +1573,15 @@ syn keyword cmakeVariable contained \ CMAKE_RC_ARCHIVE_APPEND \ CMAKE_RC_ARCHIVE_CREATE \ CMAKE_RC_ARCHIVE_FINISH + \ CMAKE_RC_BYTE_ORDER \ CMAKE_RC_CLANG_TIDY + \ CMAKE_RC_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_RC_COMPILER \ CMAKE_RC_COMPILER_ABI \ CMAKE_RC_COMPILER_AR \ CMAKE_RC_COMPILER_ARCHITECTURE_ID \ CMAKE_RC_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_RC_COMPILER_FRONTEND_VARIANT \ CMAKE_RC_COMPILER_ID \ CMAKE_RC_COMPILER_LAUNCHER \ CMAKE_RC_COMPILER_LOADED @@ -1419,6 +1596,8 @@ syn keyword cmakeVariable contained \ CMAKE_RC_CREATE_SHARED_LIBRARY \ CMAKE_RC_CREATE_SHARED_MODULE \ CMAKE_RC_CREATE_STATIC_LIBRARY + \ CMAKE_RC_EXTENSIONS + \ CMAKE_RC_EXTENSIONS_DEFAULT \ CMAKE_RC_FLAGS \ CMAKE_RC_FLAGS_DEBUG \ CMAKE_RC_FLAGS_DEBUG_INIT @@ -1437,6 +1616,7 @@ syn keyword cmakeVariable contained \ CMAKE_RC_INCLUDE_WHAT_YOU_USE \ CMAKE_RC_INIT \ CMAKE_RC_LIBRARY_ARCHITECTURE + \ CMAKE_RC_LINKER_LAUNCHER \ CMAKE_RC_LINKER_PREFERENCE \ CMAKE_RC_LINKER_PREFERENCE_PROPAGATES \ CMAKE_RC_LINKER_WRAPPER_FLAG @@ -1445,19 +1625,25 @@ syn keyword cmakeVariable contained \ CMAKE_RC_LINK_LIBRARY_FILE_FLAG \ CMAKE_RC_LINK_LIBRARY_FLAG \ CMAKE_RC_LINK_LIBRARY_SUFFIX + \ CMAKE_RC_LINK_WHAT_YOU_USE_FLAG \ CMAKE_RC_OUTPUT_EXTENSION \ CMAKE_RC_PLATFORM_ID \ CMAKE_RC_SIMULATE_ID \ CMAKE_RC_SIMULATE_VERSION \ CMAKE_RC_SIZEOF_DATA_PTR \ CMAKE_RC_SOURCE_FILE_EXTENSIONS + \ CMAKE_RC_STANDARD + \ CMAKE_RC_STANDARD_DEFAULT \ CMAKE_RC_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_RC_STANDARD_LIBRARIES + \ CMAKE_RC_STANDARD_REQUIRED + \ CMAKE_RC_SUPPORTED \ CMAKE_RC_VISIBILITY_PRESET \ CMAKE_ROOT \ CMAKE_RULE_MESSAGES \ CMAKE_RUNTIME_OUTPUT_DIRECTORY \ CMAKE_SCRIPT_MODE_FILE + \ CMAKE_SHARED_LIBRARY_ENABLE_EXPORTS \ CMAKE_SHARED_LIBRARY_PREFIX \ CMAKE_SHARED_LIBRARY_SUFFIX \ CMAKE_SHARED_LINKER_FLAGS @@ -1486,6 +1672,7 @@ syn keyword cmakeVariable contained \ CMAKE_SYSTEM_APPBUNDLE_PATH \ CMAKE_SYSTEM_FRAMEWORK_PATH \ CMAKE_SYSTEM_IGNORE_PATH + \ CMAKE_SYSTEM_IGNORE_PREFIX_PATH \ CMAKE_SYSTEM_INCLUDE_PATH \ CMAKE_SYSTEM_LIBRARY_PATH \ CMAKE_SYSTEM_NAME @@ -1500,12 +1687,15 @@ syn keyword cmakeVariable contained \ CMAKE_Swift_ARCHIVE_APPEND \ CMAKE_Swift_ARCHIVE_CREATE \ CMAKE_Swift_ARCHIVE_FINISH + \ CMAKE_Swift_BYTE_ORDER \ CMAKE_Swift_CLANG_TIDY + \ CMAKE_Swift_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_Swift_COMPILER \ CMAKE_Swift_COMPILER_ABI \ CMAKE_Swift_COMPILER_AR \ CMAKE_Swift_COMPILER_ARCHITECTURE_ID \ CMAKE_Swift_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_Swift_COMPILER_FRONTEND_VARIANT \ CMAKE_Swift_COMPILER_ID \ CMAKE_Swift_COMPILER_LAUNCHER \ CMAKE_Swift_COMPILER_LOADED @@ -1520,6 +1710,8 @@ syn keyword cmakeVariable contained \ CMAKE_Swift_CREATE_SHARED_LIBRARY \ CMAKE_Swift_CREATE_SHARED_MODULE \ CMAKE_Swift_CREATE_STATIC_LIBRARY + \ CMAKE_Swift_EXTENSIONS + \ CMAKE_Swift_EXTENSIONS_DEFAULT \ CMAKE_Swift_FLAGS \ CMAKE_Swift_FLAGS_DEBUG \ CMAKE_Swift_FLAGS_DEBUG_INIT @@ -1539,6 +1731,7 @@ syn keyword cmakeVariable contained \ CMAKE_Swift_INIT \ CMAKE_Swift_LANGUAGE_VERSION \ CMAKE_Swift_LIBRARY_ARCHITECTURE + \ CMAKE_Swift_LINKER_LAUNCHER \ CMAKE_Swift_LINKER_PREFERENCE \ CMAKE_Swift_LINKER_PREFERENCE_PROPAGATES \ CMAKE_Swift_LINKER_WRAPPER_FLAG @@ -1547,6 +1740,7 @@ syn keyword cmakeVariable contained \ CMAKE_Swift_LINK_LIBRARY_FILE_FLAG \ CMAKE_Swift_LINK_LIBRARY_FLAG \ CMAKE_Swift_LINK_LIBRARY_SUFFIX + \ CMAKE_Swift_LINK_WHAT_YOU_USE_FLAG \ CMAKE_Swift_MODULE_DIRECTORY \ CMAKE_Swift_NUM_THREADS \ CMAKE_Swift_OUTPUT_EXTENSION @@ -1555,16 +1749,25 @@ syn keyword cmakeVariable contained \ CMAKE_Swift_SIMULATE_VERSION \ CMAKE_Swift_SIZEOF_DATA_PTR \ CMAKE_Swift_SOURCE_FILE_EXTENSIONS + \ CMAKE_Swift_STANDARD + \ CMAKE_Swift_STANDARD_DEFAULT \ CMAKE_Swift_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_Swift_STANDARD_LIBRARIES + \ CMAKE_Swift_STANDARD_REQUIRED + \ CMAKE_Swift_SUPPORTED \ CMAKE_Swift_VISIBILITY_PRESET + \ CMAKE_TASKING_TOOLSET + \ CMAKE_TLS_CAINFO + \ CMAKE_TLS_VERIFY \ CMAKE_TOOLCHAIN_FILE \ CMAKE_TRY_COMPILE_CONFIGURATION + \ CMAKE_TRY_COMPILE_NO_PLATFORM_VARIABLES \ CMAKE_TRY_COMPILE_PLATFORM_VARIABLES \ CMAKE_TRY_COMPILE_TARGET_TYPE \ CMAKE_TWEAK_VERSION \ CMAKE_UNITY_BUILD \ CMAKE_UNITY_BUILD_BATCH_SIZE + \ CMAKE_UNITY_BUILD_UNIQUE_ID \ CMAKE_USER_MAKE_RULES_OVERRIDE \ CMAKE_USER_MAKE_RULES_OVERRIDE_ASM \ CMAKE_USER_MAKE_RULES_OVERRIDE_ASM_MASM @@ -1580,8 +1783,13 @@ syn keyword cmakeVariable contained \ CMAKE_USER_MAKE_RULES_OVERRIDE_Swift \ CMAKE_USE_RELATIVE_PATHS \ CMAKE_VERBOSE_MAKEFILE + \ CMAKE_VERIFY_INTERFACE_HEADER_SETS \ CMAKE_VERSION \ CMAKE_VISIBILITY_INLINES_HIDDEN + \ CMAKE_VS_DEBUGGER_COMMAND + \ CMAKE_VS_DEBUGGER_COMMAND_ARGUMENTS + \ CMAKE_VS_DEBUGGER_ENVIRONMENT + \ CMAKE_VS_DEBUGGER_WORKING_DIRECTORY \ CMAKE_VS_DEVENV_COMMAND \ CMAKE_VS_GLOBALS \ CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD @@ -1589,6 +1797,8 @@ syn keyword cmakeVariable contained \ CMAKE_VS_INTEL_Fortran_PROJECT_VERSION \ CMAKE_VS_JUST_MY_CODE_DEBUGGING \ CMAKE_VS_MSBUILD_COMMAND + \ CMAKE_VS_NO_COMPILE_BATCHING + \ CMAKE_VS_NUGET_PACKAGE_RESTORE \ CMAKE_VS_NsightTegra_VERSION \ CMAKE_VS_PLATFORM_NAME \ CMAKE_VS_PLATFORM_NAME_DEFAULT @@ -1604,11 +1814,17 @@ syn keyword cmakeVariable contained \ CMAKE_VS_SDK_LIBRARY_WINRT_DIRECTORIES \ CMAKE_VS_SDK_REFERENCE_DIRECTORIES \ CMAKE_VS_SDK_SOURCE_DIRECTORIES + \ CMAKE_VS_TARGET_FRAMEWORK_IDENTIFIER + \ CMAKE_VS_TARGET_FRAMEWORK_TARGETS_VERSION + \ CMAKE_VS_TARGET_FRAMEWORK_VERSION + \ CMAKE_VS_VERSION_BUILD_NUMBER + \ CMAKE_VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION \ CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION \ CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM \ CMAKE_VS_WINRT_BY_DEFAULT \ CMAKE_WARN_DEPRECATED \ CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION + \ CMAKE_WATCOM_RUNTIME_LIBRARY \ CMAKE_WIN32_EXECUTABLE \ CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS \ CMAKE_XCODE_BUILD_SYSTEM @@ -1623,8 +1839,12 @@ syn keyword cmakeVariable contained \ CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER \ CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS \ CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE + \ CMAKE_XCODE_SCHEME_ENABLE_GPU_API_VALIDATION + \ CMAKE_XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE + \ CMAKE_XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION \ CMAKE_XCODE_SCHEME_ENVIRONMENT \ CMAKE_XCODE_SCHEME_GUARD_MALLOC + \ CMAKE_XCODE_SCHEME_LAUNCH_CONFIGURATION \ CMAKE_XCODE_SCHEME_LAUNCH_MODE \ CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP \ CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES @@ -1639,8 +1859,10 @@ syn keyword cmakeVariable contained \ CMAKE_XCODE_SCHEME_LAUNCH_CONFIGURATION \ CMAKE_XCODE_SCHEME_WORKING_DIRECTORY \ CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS + \ CMAKE_XCODE_XCCONFIG \ CPACK_ABSOLUTE_DESTINATION_FILES \ CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY + \ CPACK_CUSTOM_INSTALL_VARIABLES \ CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION \ CPACK_INCLUDE_TOPLEVEL_DIRECTORY \ CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS @@ -1675,6 +1897,7 @@ syn keyword cmakeVariable contained \ CTEST_CUSTOM_PRE_MEMCHECK \ CTEST_CUSTOM_PRE_TEST \ CTEST_CUSTOM_TESTS_IGNORE + \ CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION \ CTEST_CUSTOM_WARNING_EXCEPTION \ CTEST_CUSTOM_WARNING_MATCH \ CTEST_CVS_CHECKOUT @@ -1707,6 +1930,7 @@ syn keyword cmakeVariable contained \ CTEST_RESOURCE_SPEC_FILE \ CTEST_RUN_CURRENT_SCRIPT \ CTEST_SCP_COMMAND + \ CTEST_SCRIPT_DIRECTORY \ CTEST_SITE \ CTEST_SOURCE_DIRECTORY \ CTEST_SUBMIT_INACTIVITY_TIMEOUT @@ -2005,6 +2229,7 @@ syn keyword cmakeVariable contained \ GHSMULTI \ IOS \ LIBRARY_OUTPUT_PATH + \ LINUX \ MINGW \ MSVC \ MSVC10 @@ -2023,6 +2248,7 @@ syn keyword cmakeVariable contained \ PROJECT_BINARY_DIR \ PROJECT_DESCRIPTION \ PROJECT_HOMEPAGE_URL + \ PROJECT_IS_TOP_LEVEL \ PROJECT_NAME \ PROJECT_SOURCE_DIR \ PROJECT_VERSION @@ -2040,6 +2266,7 @@ syn keyword cmakeVariable contained syn keyword cmakeModule contained \ ExternalProject + \ FetchContent syn keyword cmakeKWExternalProject contained \ AWS @@ -2053,10 +2280,10 @@ syn keyword cmakeKWExternalProject contained \ CMAKE_CACHE_ARGS \ CMAKE_CACHE_DEFAULT_ARGS \ CMAKE_EP_GIT_REMOTE_UPDATE_STRATEGY - \ CMAKE_TLS_CAINFO - \ CMAKE_TLS_VERIFY + \ CMAKE_INSTALL_MODE \ COMMENT \ CONFIGURE_COMMAND + \ CONFIGURE_HANDLED_BY_BUILD \ CVS \ CVSROOT \ CVS_MODULE @@ -2068,6 +2295,7 @@ syn keyword cmakeKWExternalProject contained \ DOWNLOADED_FILE \ DOWNLOAD_COMMAND \ DOWNLOAD_DIR + \ DOWNLOAD_EXTRACT_TIMESTAMP \ DOWNLOAD_NAME \ DOWNLOAD_NO_EXTRACT \ DOWNLOAD_NO_PROGRESS @@ -2159,24 +2387,90 @@ syn keyword cmakeKWExternalProject contained \ USES_TERMINAL_UPDATE \ WORKING_DIRECTORY +syn keyword cmakeKWFetchContent contained + \ ALWAYS + \ BINARY_DIR + \ BUILD_COMMAND + \ BYPASS_PROVIDER + \ CMAKE_PROJECT_ + \ CONFIGURE_COMMAND + \ COPY + \ CORRECT + \ DCMAKE_TOOLCHAIN_FILE + \ DESTINATION + \ DOWNLOAD_NO_EXTRACT + \ EXISTS + \ FETCHCONTENT_BASE_DIR + \ FETCHCONTENT_FULLY_DISCONNECTED + \ FETCHCONTENT_MAKEAVAILABLE_SERIAL + \ FETCHCONTENT_QUIET + \ FETCHCONTENT_SOURCE_DIR_ + \ FETCHCONTENT_TRY_FIND_PACKAGE_MODE + \ FETCHCONTENT_UPDATES_DISCONNECTED + \ FETCHCONTENT_UPDATES_DISCONNECTED_ + \ FIND_PACKAGE_ARGS + \ GIT_REPOSITORY + \ GIT_TAG + \ GLOBAL + \ GTEST_BOTH_LIBRARIES + \ GTEST_LIBRARIES + \ GTEST_MAIN_LIBRARIES + \ INSTALL_COMMAND + \ INTERNAL + \ NAME + \ NAMES + \ NEVER + \ NOTE + \ OFF + \ OPTIONAL + \ OPT_IN + \ OVERRIDE_FIND_PACKAGE + \ PACKAGE_VERSION_COMPATIBLE + \ PACKAGE_VERSION_EXACT + \ QUIET + \ SOURCE_SUBDIR + \ STREQUAL + \ SUBBUILD_DIR + \ SVN_REPOSITORY + \ SVN_REVISION + \ SYSTEM + \ TARGET + \ TEST_COMMAND + \ TRUE + \ URL + \ URL_HASH + \ VERIFY_INTERFACE_HEADER_SETS + \ WRITE + \ WRONG + \ _BINARY_DIR + \ _INCLUDE + \ _POPULATED + \ _SOURCE_DIR + syn keyword cmakeKWadd_compile_definitions contained \ COMPILE_DEFINITIONS \ VAR syn keyword cmakeKWadd_compile_options contained + \ CMAKE_ + \ COMPILE_LANGUAGE \ COMPILE_OPTIONS + \ CONFIG \ SHELL \ UNIX_COMMAND - \ WX + \ _FLAGS + \ _FLAGS_ syn keyword cmakeKWadd_custom_command contained \ APPEND \ ARGS + \ BNF \ BYPRODUCTS \ CC \ COMMAND \ COMMAND_EXPAND_LISTS \ COMMENT + \ CONFIG \ CROSSCOMPILING_EMULATOR \ DEPENDS \ DEPENDS_EXPLICIT_ONLY @@ -2188,6 +2482,7 @@ syn keyword cmakeKWadd_custom_command contained \ JOB_POOLS \ JOIN \ MAIN_DEPENDENCY + \ MODULE \ NOT \ OUTPUT \ PATH @@ -2263,17 +2558,21 @@ syn keyword cmakeKWadd_library contained \ FRAMEWORK \ GLOBAL \ HEADER_FILE_ONLY + \ HEADER_SETS \ IMPORTED \ IMPORTED_ \ IMPORTED_IMPLIB \ IMPORTED_IMPLIB_ \ IMPORTED_LOCATION \ IMPORTED_LOCATION_ + \ IMPORTED_NO_SONAME \ IMPORTED_OBJECTS \ IMPORTED_OBJECTS_ + \ IMPORTED_SONAME \ INTERFACE \ INTERFACE_ \ INTERFACE_SOURCES + \ LC_ID_DYLIB \ LIBRARY_OUTPUT_DIRECTORY \ MODULE \ OBJECT @@ -2283,22 +2582,25 @@ syn keyword cmakeKWadd_library contained \ POST_BUILD \ PRE_BUILD \ PRE_LINK - \ PRIVATE - \ PUBLIC + \ PRIVATE_HEADER + \ PUBLIC_HEADER \ RUNTIME_OUTPUT_DIRECTORY \ SHARED + \ SONAME \ SOURCES \ STATIC + \ TARGETS \ TARGET_OBJECTS + \ TARGET_RUNTIME_DLLS \ UNKNOWN syn keyword cmakeKWadd_link_options contained \ CMAKE_ + \ CONFIG \ CUDA_RESOLVE_DEVICE_SYMBOLS \ CUDA_SEPARABLE_COMPILATION \ DEVICE_LINK \ GCC - \ GNU \ HOST_LINK \ LANG \ LINKER @@ -2306,11 +2608,14 @@ syn keyword cmakeKWadd_link_options contained \ SHELL \ STATIC_LIBRARY_OPTIONS \ UNIX_COMMAND + \ _FLAGS + \ _FLAGS_ \ _LINKER_WRAPPER_FLAG \ _LINKER_WRAPPER_FLAG_SEP syn keyword cmakeKWadd_subdirectory contained \ EXCLUDE_FROM_ALL + \ SYSTEM syn keyword cmakeKWadd_test contained \ BUILD_TESTING @@ -2324,15 +2629,64 @@ syn keyword cmakeKWadd_test contained \ SKIP_REGULAR_EXPRESSION \ TARGET_FILE \ WILL_FAIL + \ WILL_FALL \ WORKING_DIRECTORY +syn keyword cmakeKWblock contained + \ PARENT_SCOPE + \ POLICIES + \ PROPAGATE + \ PUSH + \ SCOPE_FOR + \ TRUE + \ VARIABLES + syn keyword cmakeKWbuild_command contained \ CONFIGURATION + \ PARALLEL_LEVEL \ TARGET +syn keyword cmakeKWcmake_file_api contained + \ API + \ API_VERSION + \ BUILD_DIR + \ CMAKEFILES + \ CODEMODEL + \ COMMAND + \ CONFIG + \ QUERY + \ TOOLCHAINS + syn keyword cmakeKWcmake_host_system_information contained + \ APPEND \ AVAILABLE_PHYSICAL_MEMORY \ AVAILABLE_VIRTUAL_MEMORY + \ BOTH + \ CMAKE_GET_OS_RELEASE_FALLBACK_CONTENT + \ CMAKE_GET_OS_RELEASE_FALLBACK_RESULT_ + \ CMAKE_GET_OS_RELEASE_FALLBACK_RESULT_ID + \ CMAKE_GET_OS_RELEASE_FALLBACK_RESULT_NAME + \ CMAKE_GET_OS_RELEASE_FALLBACK_RESULT_PRETTY_NAME + \ CMAKE_GET_OS_RELEASE_FALLBACK_RESULT_VERSION + \ CMAKE_GET_OS_RELEASE_FALLBACK_RESULT_VERSION_ID + \ CMAKE_GET_OS_RELEASE_FALLBACK_SCRIPTS + \ DISTRIB_INFO + \ DISTRIB_PRETTY_NAME + \ DISTRO + \ DISTRO_BUG_REPORT_URL + \ DISTRO_HOME_URL + \ DISTRO_ID + \ DISTRO_ID_LIKE + \ DISTRO_NAME + \ DISTRO_PRETTY_NAME + \ DISTRO_PRIVACY_POLICY_URL + \ DISTRO_SUPPORT_URL + \ DISTRO_UBUNTU_CODENAME + \ DISTRO_VERSION + \ DISTRO_VERSION_CODENAME + \ DISTRO_VERSION_ID + \ ERROR_VARIABLE + \ EXISTS \ FQDN \ HAS_FPU \ HAS_MMX @@ -2341,38 +2695,101 @@ syn keyword cmakeKWcmake_host_system_information contained \ HAS_SSE \ HAS_SSE_FP \ HAS_SSE_MMX + \ HKCC + \ HKCR + \ HKCU + \ HKEY_CLASSES_ROOT + \ HKEY_CURRENT_CONFIG + \ HKEY_CURRENT_USER + \ HKEY_LOCAL_MACHINE + \ HKEY_USERS + \ HKLM + \ HKU \ HOSTNAME \ ID + \ LIMIT_COUNT + \ LISTS + \ LTS + \ MATCHES + \ NNN + \ NOT \ NUMBER_OF_LOGICAL_CORES \ NUMBER_OF_PHYSICAL_CORES \ OS_NAME \ OS_PLATFORM \ OS_RELEASE \ OS_VERSION + \ PRETTY_NAME \ PROCESSOR_DESCRIPTION \ PROCESSOR_NAME \ PROCESSOR_SERIAL_NUMBER \ QUERY + \ REG_DWORD + \ REG_EXPAND_SZ + \ REG_MULTI_SZ + \ REG_QWORD + \ REG_SZ \ RESULT + \ SEPARATOR + \ SOFTWARE + \ STATUS + \ STRINGS + \ SUBKEYS + \ TARGET \ TOTAL_PHYSICAL_MEMORY \ TOTAL_VIRTUAL_MEMORY + \ VALUE_NAMES + \ VAR + \ VIEW + \ WINDOWS_REGISTRY syn keyword cmakeKWcmake_language contained \ AND + \ ANY + \ APPEND + \ ARGN + \ BINARY_DIR + \ BYPASS_PROVIDER \ CALL \ CANCEL_CALL \ CODE + \ COMMAND + \ COMMAND_ERROR_IS_FATAL + \ DCMAKE_PROJECT_TOP_LEVEL_INCLUDES \ DEFER \ DIRECTORY \ EVAL \ FALSE + \ FETCHCONTENT_MAKEAVAILABE_SERIAL + \ FETCHCONTENT_MAKEAVAILABLE_SERIAL + \ FETCHCONTENT_SOURCE_DIR_ + \ FETCHCONTENT_TRY_FIND_PACKAGE_MODE + \ FIND_PACKAGE + \ FIND_PACKAGE_ARGS \ GET_CALL_IDS - \ ID + \ GET_MESSAGE_LOG_LEVEL + \ GIT_REPOSITORY + \ GIT_SUBMODULES + \ GIT_TAG \ ID_VAR - \ OR + \ MATCHES + \ MYCOMP_PROVIDER_INSTALL_DIR + \ NEVER + \ NOT + \ OVERRIDE_FIND_PACKAGE + \ PATH + \ POP_BACK + \ QUIET + \ SET_DEPENDENCY_PROVIDER + \ SOURCE_DIR \ STATUS + \ STREQUAL + \ SUPPORTED_METHODS \ TRUE + \ VERSION \ WRITE + \ _FOUND + \ _PATH syn keyword cmakeKWcmake_minimum_required contained \ FATAL_ERROR @@ -2407,22 +2824,21 @@ syn keyword cmakeKWcmake_path contained \ ABSOLUTE_PATH \ AND \ APPEND + \ APPEND_STRING \ BASE_DIRECTORY - \ CMAKE_PATH \ COMPARE - \ CONCAT \ CONVERT - \ ELSEIF - \ ENDIF + \ EQUAL \ EXTENSION \ EXTENSION_DEF \ FALSE + \ FILENAME \ FILENAME_DEF \ GET \ GET_EXTENSION \ GET_FILENAME \ GET_PARENT_PATH - \ GET_RELATIVE_PATH + \ GET_RELATIVE_PART \ GET_ROOT_DIRECTORY \ GET_ROOT_NAME \ GET_ROOT_PATH @@ -2431,12 +2847,11 @@ syn keyword cmakeKWcmake_path contained \ HAS_EXTENSION \ HAS_FILENAME \ HAS_PARENT_PATH - \ HAS_RELATIVE_PATH + \ HAS_RELATIVE_PART \ HAS_ROOT_DIRECTORY \ HAS_ROOT_NAME \ HAS_ROOT_PATH \ HAS_STEM - \ IF \ IS_ABSOLUTE \ IS_PREFIX \ IS_RELATIVE @@ -2445,23 +2860,21 @@ syn keyword cmakeKWcmake_path contained \ NATIVE_PATH \ NORMALIZE \ NORMAL_PATH - \ NOT \ NOT_EQUAL \ OP - \ OS \ OUTPUT_VARIABLE \ PARENT_PATH - \ PROXIMATE_PATH \ REAL_PATH + \ RELATIVE_PART \ RELATIVE_PATH \ REMOVE_EXTENSION \ REMOVE_FILENAME \ REPLACE_EXTENSION \ REPLACE_FILENAME - \ RETURN \ ROOT_DIRECTORY \ ROOT_NAME \ ROOT_PATH + \ SET \ STEM \ STREQUAL \ TO_CMAKE_PATH_LIST @@ -2476,8 +2889,10 @@ syn keyword cmakeKWcmake_policy contained \ NNNN \ NO_POLICY_SCOPE \ OLD + \ POLICIES \ POP \ PUSH + \ SCOPE_FOR \ SET \ VERSION @@ -2489,9 +2904,14 @@ syn keyword cmakeKWconfigure_file contained \ FILE_PERMISSIONS \ FOO_ENABLE \ FOO_STRING + \ GENERATE + \ INTERFACE \ LF \ NEWLINE_STYLE \ NO_SOURCE_PERMISSIONS + \ PRIVATE + \ PUBLIC + \ SYSTEM \ USE_SOURCE_PERMISSIONS \ VAR @@ -2506,6 +2926,7 @@ syn keyword cmakeKWctest_build contained \ APPEND \ BUILD \ CAPTURE_CMAKE_ERROR + \ CMAKE_BUILD_PARALLEL_LEVEL \ CONFIGURATION \ CTEST_BUILD_CONFIGURATION \ CTEST_BUILD_FLAGS @@ -2513,6 +2934,7 @@ syn keyword cmakeKWctest_build contained \ FLAGS \ NUMBER_ERRORS \ NUMBER_WARNINGS + \ PARALLEL_LEVEL \ QUIET \ RETURN_VALUE \ TARGET @@ -2537,6 +2959,7 @@ syn keyword cmakeKWctest_coverage contained syn keyword cmakeKWctest_memcheck contained \ APPEND \ BUILD + \ CAPTURE_CMAKE_ERROR \ DEFECT_COUNT \ EXCLUDE \ EXCLUDE_FIXTURE @@ -2547,11 +2970,15 @@ syn keyword cmakeKWctest_memcheck contained \ INCLUDE_LABEL \ OFF \ ON + \ OUTPUT_JUNIT \ PARALLEL_LEVEL \ QUIET + \ REPEAT + \ RESOURCE_SPEC_FILE \ RETURN_VALUE \ SCHEDULE_RANDOM \ START + \ STOP_ON_FAILURE \ STOP_TIME \ STRIDE \ TEST_LOAD @@ -2587,6 +3014,8 @@ syn keyword cmakeKWctest_submit contained syn keyword cmakeKWctest_test contained \ AFTER_TIMEOUT \ APPEND + \ ATTACHED_FILES + \ ATTACHED_FILES_ON_FAIL \ BUILD \ CAPTURE_CMAKE_ERROR \ CPU @@ -2597,8 +3026,10 @@ syn keyword cmakeKWctest_test contained \ EXCLUDE_LABEL \ INCLUDE \ INCLUDE_LABEL + \ LABELS \ OFF \ ON + \ OUTPUT_JUNIT \ PARALLEL_LEVEL \ QUIET \ REPEAT @@ -2612,6 +3043,8 @@ syn keyword cmakeKWctest_test contained \ TEST_LOAD \ UNTIL_FAIL \ UNTIL_PASS + \ URL + \ XML syn keyword cmakeKWctest_update contained \ CAPTURE_CMAKE_ERROR @@ -2629,15 +3062,18 @@ syn keyword cmakeKWdefine_property contained \ APPEND_STRING \ BRIEF_DOCS \ CACHED_VARIABLE + \ CMAKE_ \ DIRECTORY \ FULL_DOCS \ GLOBAL \ INHERITED + \ INITIALIZE_FROM_VARIABLE \ PROPERTY \ SOURCE \ TARGET \ TEST \ VARIABLE + \ _CMAKE_ syn keyword cmakeKWdoxygen_add_docs contained \ ALL @@ -2647,6 +3083,10 @@ syn keyword cmakeKWdoxygen_add_docs contained syn keyword cmakeKWenable_language contained \ ASM + \ ASM_MARMASM + \ ASM_MASM + \ ASM_NASM + \ ATT \ CUDA \ HIP \ ISPC @@ -2684,6 +3124,7 @@ syn keyword cmakeKWexecute_process contained \ OUTPUT_QUIET \ OUTPUT_STRIP_TRAILING_WHITESPACE \ OUTPUT_VARIABLE + \ POSIX \ RESULTS_VARIABLE \ RESULT_VARIABLE \ RFC @@ -2691,17 +3132,17 @@ syn keyword cmakeKWexecute_process contained \ STDOUT \ TIMEOUT \ UTF - \ VERBATIM \ WORKING_DIRECTORY syn keyword cmakeKWexport contained \ ANDROID_MK \ APPEND + \ CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API \ CONFIG + \ CXX_MODULES_DIRECTORY \ EXPORT \ EXPORT_LINK_INTERFACE_LIBRARIES \ FILE - \ IMPORTED \ IMPORTED_ \ NAMESPACE \ NDK @@ -2717,7 +3158,6 @@ syn keyword cmakeKWexport_library_dependencies contained \ SET syn keyword cmakeKWfile contained - \ ALGO \ APPEND \ ARCHIVE_CREATE \ ARCHIVE_EXTRACT @@ -2729,9 +3169,8 @@ syn keyword cmakeKWfile contained \ CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND \ CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM \ CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL + \ CMAKE_INSTALL_MODE \ CMAKE_OBJDUMP - \ CMAKE_TLS_CAINFO - \ CMAKE_TLS_VERIFY \ CODE \ COMPILE_FEATURES \ COMPRESSION @@ -2742,7 +3181,8 @@ syn keyword cmakeKWfile contained \ CONFLICTING_DEPENDENCIES_PREFIX \ CONTENT \ CONVERT - \ COPY + \ COPYONLY + \ COPY_FILE \ COPY_ON_ERROR \ CREATE_LINK \ CRLF @@ -2755,6 +3195,7 @@ syn keyword cmakeKWfile contained \ ENCODING \ ESCAPE_QUOTES \ EXECUTABLES + \ EXPAND_TILDE \ EXPECTED_HASH \ FILES_MATCHING \ FILE_PERMISSIONS @@ -2772,10 +3213,12 @@ syn keyword cmakeKWfile contained \ GUARD \ HASH \ HEX + \ HOME \ HTTPHEADER \ IGNORED \ INACTIVITY_TIMEOUT \ INPUT + \ INPUT_MAY_BE_RECENT \ INSTALL \ IS_ABSOLUTE \ LENGTH_MAXIMUM @@ -2800,9 +3243,11 @@ syn keyword cmakeKWfile contained \ NEWLINE_STYLE \ NOT \ NO_HEX_CONVERSION + \ NO_REPLACE \ NO_SOURCE_PERMISSIONS \ OFFSET \ ONLY + \ ONLY_IF_DIFFERENT \ OPTIONAL \ OUTPUT \ OWNER_EXECUTE @@ -2812,11 +3257,15 @@ syn keyword cmakeKWfile contained \ PATTERN \ PATTERNS \ PERMISSIONS + \ POST_EXCLUDE_FILES \ POST_EXCLUDE_REGEXES + \ POST_INCLUDE_FILES \ POST_INCLUDE_REGEXES \ PRE_EXCLUDE_REGEXES \ PRE_INCLUDE_REGEXES \ PROCESS + \ RANGE_END + \ RANGE_START \ READ \ READ_SYMLINK \ REAL_PATH @@ -2833,7 +3282,10 @@ syn keyword cmakeKWfile contained \ RESULT_VARIABLE \ RPATH \ RUNPATH + \ RUNTIME_DEPENDENCY_SET \ SCRIPT + \ SETGID + \ SETUID \ SHARED \ SHOW_PROGRESS \ SIZE @@ -2856,6 +3308,7 @@ syn keyword cmakeKWfile contained \ UNRESOLVED_DEPENDENCIES_VAR \ UPLOAD \ URL + \ USERPROFILE \ USERPWD \ USE_SOURCE_PERMISSIONS \ UTC @@ -2869,54 +3322,87 @@ syn keyword cmakeKWfile contained \ _FILENAMES syn keyword cmakeKWfind_file contained + \ BOTH + \ CATEGORY \ CMAKE_FIND_ROOT_PATH_BOTH + \ CMAKE_FIND_USE_ \ DOC \ DVAR \ FALSE + \ FIND_XXX_REGISTRY_VIEW \ HINTS + \ HOST \ INCLUDE + \ MATCHES \ NAMES + \ NOT + \ NO_CACHE \ NO_CMAKE_ENVIRONMENT_PATH \ NO_CMAKE_FIND_ROOT_PATH + \ NO_CMAKE_INSTALL_PREFIX \ NO_CMAKE_PATH \ NO_CMAKE_SYSTEM_PATH \ NO_DEFAULT_PATH \ NO_PACKAGE_ROOT_PATH \ NO_SYSTEM_ENVIRONMENT_PATH \ ONLY_CMAKE_FIND_ROOT_PATH + \ PACKAGENAME + \ PARENT_SCOPE \ PATHS \ PATH_SUFFIXES + \ REGISTRY_VIEW \ REQUIRED + \ TARGET + \ VALIDATOR \ VAR syn keyword cmakeKWfind_library contained + \ BOTH + \ CATEGORY \ CMAKE_FIND_ROOT_PATH_BOTH + \ CMAKE_FIND_USE_ \ DOC \ DVAR \ FALSE + \ FIND_XXX_REGISTRY_VIEW \ HINTS - \ INCLUDE + \ HOST + \ LIB + \ MATCHES \ NAMES \ NAMES_PER_DIR + \ NOT + \ NO_CACHE \ NO_CMAKE_ENVIRONMENT_PATH \ NO_CMAKE_FIND_ROOT_PATH + \ NO_CMAKE_INSTALL_PREFIX \ NO_CMAKE_PATH \ NO_CMAKE_SYSTEM_PATH \ NO_DEFAULT_PATH \ NO_PACKAGE_ROOT_PATH \ NO_SYSTEM_ENVIRONMENT_PATH \ ONLY_CMAKE_FIND_ROOT_PATH + \ PACKAGENAME + \ PARENT_SCOPE \ PATHS \ PATH_SUFFIXES + \ REGISTRY_VIEW \ REQUIRED + \ TARGET + \ VALIDATOR \ VAR syn keyword cmakeKWfind_package contained \ ABI + \ BOTH \ BUNDLE + \ BYPASS_PROVIDER + \ CATEGORY \ CMAKE_DISABLE_FIND_PACKAGE_ \ CMAKE_REQUIRE_FIND_PACKAGE_ \ CMAKE_FIND_ROOT_PATH_BOTH + \ CMAKE_FIND_USE_ + \ CMAKE_REQUIRE_FIND_PACKAGE_ \ COMPONENTS \ CONFIG \ CONFIGS @@ -2927,7 +3413,9 @@ syn keyword cmakeKWfind_package contained \ FALSE \ FIND_PACKAGE_VERSION_FORMAT \ FRAMEWORK + \ GLOBAL \ HINTS + \ HOST \ INCLUDE \ MODULE \ NAMES @@ -2935,6 +3423,7 @@ syn keyword cmakeKWfind_package contained \ NO_CMAKE_BUILDS_PATH \ NO_CMAKE_ENVIRONMENT_PATH \ NO_CMAKE_FIND_ROOT_PATH + \ NO_CMAKE_INSTALL_PREFIX \ NO_CMAKE_PACKAGE_REGISTRY \ NO_CMAKE_PATH \ NO_CMAKE_SYSTEM_PACKAGE_REGISTRY @@ -2944,8 +3433,10 @@ syn keyword cmakeKWfind_package contained \ NO_PACKAGE_ROOT_PATH \ NO_POLICY_SCOPE \ NO_SYSTEM_ENVIRONMENT_PATH + \ OLD \ ONLY_CMAKE_FIND_ROOT_PATH \ OPTIONAL_COMPONENTS + \ PACKAGENAME \ PACKAGE_FIND_NAME \ PACKAGE_FIND_VERSION \ PACKAGE_FIND_VERSION_COMPLETE @@ -2974,60 +3465,92 @@ syn keyword cmakeKWfind_package contained \ PATHS \ PATH_SUFFIXES \ QUIET + \ REGISTRY_VIEW \ REQUIRED \ SET + \ TARGET \ TRUE + \ VALUE \ _CONFIG \ _CONSIDERED_CONFIGS \ _CONSIDERED_VERSIONS \ _DIR \ _FIND_COMPONENTS \ _FIND_QUIETLY + \ _FIND_REGISTRY_VIEW \ _FIND_REQUIRED \ _FIND_REQUIRED_ \ _FIND_VERSION_EXACT \ _FOUND syn keyword cmakeKWfind_path contained + \ BOTH + \ CATEGORY \ CMAKE_FIND_ROOT_PATH_BOTH + \ CMAKE_FIND_USE_ \ DOC \ DVAR \ FALSE + \ FIND_XXX_REGISTRY_VIEW \ HINTS + \ HOST \ INCLUDE + \ MATCHES \ NAMES + \ NOT + \ NO_CACHE \ NO_CMAKE_ENVIRONMENT_PATH \ NO_CMAKE_FIND_ROOT_PATH + \ NO_CMAKE_INSTALL_PREFIX \ NO_CMAKE_PATH \ NO_CMAKE_SYSTEM_PATH \ NO_DEFAULT_PATH \ NO_PACKAGE_ROOT_PATH \ NO_SYSTEM_ENVIRONMENT_PATH \ ONLY_CMAKE_FIND_ROOT_PATH + \ PACKAGENAME + \ PARENT_SCOPE \ PATHS \ PATH_SUFFIXES + \ REGISTRY_VIEW \ REQUIRED + \ TARGET + \ VALIDATOR \ VAR syn keyword cmakeKWfind_program contained + \ BOTH + \ CATEGORY \ CMAKE_FIND_ROOT_PATH_BOTH + \ CMAKE_FIND_USE_ \ DOC \ DVAR \ FALSE + \ FIND_XXX_REGISTRY_VIEW \ HINTS + \ HOST + \ MATCHES \ NAMES \ NAMES_PER_DIR + \ NOT + \ NO_CACHE \ NO_CMAKE_ENVIRONMENT_PATH \ NO_CMAKE_FIND_ROOT_PATH + \ NO_CMAKE_INSTALL_PREFIX \ NO_CMAKE_PATH \ NO_CMAKE_SYSTEM_PATH \ NO_DEFAULT_PATH \ NO_PACKAGE_ROOT_PATH \ NO_SYSTEM_ENVIRONMENT_PATH \ ONLY_CMAKE_FIND_ROOT_PATH + \ PACKAGENAME + \ PARENT_SCOPE \ PATHS \ PATH_SUFFIXES + \ REGISTRY_VIEW \ REQUIRED + \ TARGET + \ VALIDATOR \ VAR syn keyword cmakeKWfltk_wrap_ui contained @@ -3070,17 +3593,19 @@ syn keyword cmakeKWget_filename_component contained \ NAME \ NAME_WE \ NAME_WLE - \ PATH \ PROGRAM \ PROGRAM_ARGS + \ QUERY \ REALPATH \ REAL_PATH + \ WINDOWS_REGISTRY syn keyword cmakeKWget_property contained \ BRIEF_DOCS \ DEFINED \ DIRECTORY \ FULL_DOCS + \ GENERATED \ GLOBAL \ INSTALL \ PROPERTY @@ -3093,6 +3618,7 @@ syn keyword cmakeKWget_property contained syn keyword cmakeKWget_source_file_property contained \ DIRECTORY + \ GENERATED \ INHERITED \ LOCATION \ TARGET_DIRECTORY @@ -3109,6 +3635,7 @@ syn keyword cmakeKWif contained \ CMAKE_MATCH_ \ CMP \ COMMAND + \ COMPARE \ DEFINED \ EQUAL \ EXISTS @@ -3128,6 +3655,7 @@ syn keyword cmakeKWif contained \ NOT \ OFF \ OR + \ PATH_EQUAL \ POLICY \ STREQUAL \ STRGREATER @@ -3172,11 +3700,14 @@ syn keyword cmakeKWinclude_guard contained syn keyword cmakeKWinstall contained \ AFTER \ AIX + \ ALL_COMPONENTS \ APT \ ARCHIVE \ BEFORE \ BUILD_TYPE \ BUNDLE + \ BUNDLE_EXECUTABLE + \ CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API \ CMAKE_INSTALL_BINDIR \ CMAKE_INSTALL_DATADIR \ CMAKE_INSTALL_DATAROOTDIR @@ -3187,6 +3718,7 @@ syn keyword cmakeKWinstall contained \ CMAKE_INSTALL_LOCALEDIR \ CMAKE_INSTALL_LOCALSTATEDIR \ CMAKE_INSTALL_MANDIR + \ CMAKE_INSTALL_MODE \ CMAKE_INSTALL_RUNSTATEDIR \ CMAKE_INSTALL_SBINDIR \ CMAKE_INSTALL_SHARESTATEDIR @@ -3195,6 +3727,8 @@ syn keyword cmakeKWinstall contained \ COMPONENT \ CONFIGURATIONS \ CVS + \ CXX_MODULES_BMI + \ CXX_MODULES_DIRECTORY \ DATA \ DATAROOT \ DBUILD_TYPE @@ -3207,6 +3741,7 @@ syn keyword cmakeKWinstall contained \ DOC \ ENABLE_EXPORTS \ EXCLUDE_FROM_ALL + \ EXECUTABLES \ EXPORT \ EXPORT_ANDROID_MK \ EXPORT_LINK_INTERFACE_LIBRARIES @@ -3214,14 +3749,18 @@ syn keyword cmakeKWinstall contained \ FILES \ FILES_MATCHING \ FILE_PERMISSIONS + \ FILE_SET \ FRAMEWORK + \ GET_RUNTIME_DEPENDENCIES \ GROUP_EXECUTE \ GROUP_READ \ GROUP_WRITE - \ IMPORTED_ + \ HEADERS + \ IMPORTED_RUNTIME_ARTIFACTS \ INCLUDES \ INFO \ INSTALL_PREFIX + \ INTERFACE \ INTERFACE_INCLUDE_DIRECTORIES \ LIBRARY \ LOCALE @@ -3241,18 +3780,24 @@ syn keyword cmakeKWinstall contained \ OWNER_WRITE \ PATTERN \ PERMISSIONS + \ POST_EXCLUDE_FILES + \ POST_EXCLUDE_REGEXES + \ POST_INCLUDE_FILES + \ POST_INCLUDE_REGEXES \ POST_INSTALL_SCRIPT + \ PRE_EXCLUDE_REGEXES + \ PRE_INCLUDE_REGEXES \ PRE_INSTALL_SCRIPT \ PRIVATE_HEADER \ PROGRAMS \ PROPERTIES \ PUBLIC_HEADER - \ REGEX \ RENAME \ RESOURCE \ RPM \ RUNSTATE - \ RUNTIME + \ RUNTIME_DEPENDENCIES + \ RUNTIME_DEPENDENCY_SET \ SBIN \ SCRIPT \ SETGID @@ -3333,6 +3878,11 @@ syn keyword cmakeKWlist contained \ TOLOWER \ TOUPPER \ TRANSFORM + \ TRANSFORM_APPEND + \ TRANSFORM_GENEX_STRIP + \ TRANSFORM_REPLACE + \ TRANSFORM_STRIP + \ TRANSFORM_TOLOWER syn keyword cmakeKWload_cache contained \ EXCLUDE @@ -3370,10 +3920,15 @@ syn keyword cmakeKWmessage contained \ CHECK_FAIL \ CHECK_PASS \ CHECK_START + \ CONFIGURE_LOG \ DEBUG + \ DEFINED \ DEPRECATION \ FATAL_ERROR + \ GET_MESSAGE_LOG_LEVEL \ GUI + \ INTERNAL + \ MY_CHECK_RESULT \ NOTICE \ POP_BACK \ SEND_ERROR @@ -3384,10 +3939,13 @@ syn keyword cmakeKWmessage contained syn keyword cmakeKWoption contained \ OFF - \ ON syn keyword cmakeKWproject contained \ ASM + \ ASM_MARMASM + \ ASM_MASM + \ ASM_NASM + \ ATT \ CMAKE_PROJECT_ \ CUDA \ DESCRIPTION @@ -3405,6 +3963,7 @@ syn keyword cmakeKWproject contained \ _DESCRIPTION \ _HOMEPAGE_URL \ _INCLUDE_BEFORE + \ _IS_TOP_LEVEL \ _SOURCE_DIR \ _VERSION \ _VERSION_MAJOR @@ -3424,6 +3983,11 @@ syn keyword cmakeKWremove contained syn keyword cmakeKWreturn contained \ DEFER + \ PARENT_SCOPE + \ PROPAGATE + \ SCOPE_FOR + \ VARIABLES + \ VERSION syn keyword cmakeKWseparate_arguments contained \ MSDN @@ -3439,10 +4003,13 @@ syn keyword cmakeKWset contained \ FORCE \ INTERNAL \ OFF + \ OLD \ ON \ PARENT_SCOPE + \ PROPAGATE \ STRING \ STRINGS + \ VAR syn keyword cmakeKWset_directory_properties contained \ DIRECTORY @@ -3452,9 +4019,11 @@ syn keyword cmakeKWset_property contained \ APPEND \ APPEND_STRING \ DIRECTORY + \ GENERATED \ GLOBAL \ INHERITED \ INSTALL + \ NAME \ PROPERTY \ SOURCE \ TARGET @@ -3464,17 +4033,17 @@ syn keyword cmakeKWset_property contained syn keyword cmakeKWset_source_files_properties contained \ DIRECTORY + \ GENERATED \ PROPERTIES \ SOURCE \ TARGET_DIRECTORY syn keyword cmakeKWset_target_properties contained \ PROPERTIES - \ TARGET syn keyword cmakeKWset_tests_properties contained + \ NAME \ PROPERTIES - \ TEST syn keyword cmakeKWsite_name contained \ HOSTNAME @@ -3506,9 +4075,9 @@ syn keyword cmakeKWstring contained \ GUID \ HASH \ HEX + \ ISO \ JOIN \ JSON - \ JSONLENGTH \ LENGTH \ LESS \ LESS_EQUAL @@ -3573,7 +4142,10 @@ syn keyword cmakeKWtarget_compile_features contained syn keyword cmakeKWtarget_compile_options contained \ ALIAS \ BEFORE + \ CMAKE_ + \ COMPILE_LANGUAGE \ COMPILE_OPTIONS + \ CONFIG \ IMPORTED \ INTERFACE \ INTERFACE_COMPILE_OPTIONS @@ -3581,8 +4153,11 @@ syn keyword cmakeKWtarget_compile_options contained \ PUBLIC \ SHELL \ UNIX_COMMAND + \ _FLAGS + \ _FLAGS_ syn keyword cmakeKWtarget_include_directories contained + \ AFTER \ ALIAS \ BEFORE \ BUILD_INTERFACE @@ -3619,6 +4194,7 @@ syn keyword cmakeKWtarget_link_libraries contained \ IMPORTED_NO_SONAME \ INTERFACE \ INTERFACE_LINK_LIBRARIES + \ LINK_FLAGS \ LINK_INTERFACE_LIBRARIES \ LINK_INTERFACE_LIBRARIES_DEBUG \ LINK_INTERFACE_MULTIPLICITY @@ -3631,16 +4207,17 @@ syn keyword cmakeKWtarget_link_libraries contained \ PUBLIC \ SHARED \ STATIC + \ TARGET_OBJECTS syn keyword cmakeKWtarget_link_options contained \ ALIAS \ BEFORE \ CMAKE_ + \ CONFIG \ CUDA_RESOLVE_DEVICE_SYMBOLS \ CUDA_SEPARABLE_COMPILATION \ DEVICE_LINK \ GCC - \ GNU \ HOST_LINK \ IMPORTED \ INTERFACE @@ -3653,6 +4230,8 @@ syn keyword cmakeKWtarget_link_options contained \ SHELL \ STATIC_LIBRARY_OPTIONS \ UNIX_COMMAND + \ _FLAGS + \ _FLAGS_ \ _LINKER_WRAPPER_FLAG \ _LINKER_WRAPPER_FLAG_SEP @@ -3677,15 +4256,46 @@ syn keyword cmakeKWtarget_precompile_headers contained syn keyword cmakeKWtarget_sources contained \ ALIAS + \ BASE_DIRS + \ BUILD_INTERFACE + \ CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API + \ CONFIG + \ CORRECT + \ CXX_MODULES + \ CXX_MODULE_DIRS + \ CXX_MODULE_DIRS_ + \ CXX_MODULE_SETS + \ CXX_MODULE_SET_ + \ EXPORT + \ FILES + \ FILE_SET + \ FRAMEWORK + \ HEADERS + \ HEADER_DIRS + \ HEADER_DIRS_ + \ HEADER_FILE_ONLY + \ HEADER_SETS + \ HEADER_SET_ \ IMPORTED + \ INCLUDE_DIRECTORIES \ INTERFACE + \ INTERFACE_CXX_MODULE_SETS + \ INTERFACE_HEADER_SETS + \ INTERFACE_INCLUDE_DIRECTORIES \ INTERFACE_SOURCES + \ NAME \ PRIVATE \ PUBLIC \ SOURCES + \ SOURCE_DIR + \ TARGETS + \ TRUE + \ TYPE + \ WRONG syn keyword cmakeKWtry_compile contained \ ALL_BUILD + \ BINARY_DIR \ CMAKE_FLAGS \ COMPILE_DEFINITIONS \ COPY_FILE @@ -3713,8 +4323,11 @@ syn keyword cmakeKWtry_compile contained \ LINK_DIRECTORIES \ LINK_LIBRARIES \ LINK_OPTIONS + \ LOG_DESCRIPTION \ MULTI \ NOT + \ NO_CACHE + \ NO_LOG \ OBJCXX_EXTENSIONS \ OBJCXX_STANDARD \ OBJCXX_STANDARD_REQUIRED @@ -3723,9 +4336,16 @@ syn keyword cmakeKWtry_compile contained \ OBJC_STANDARD_REQUIRED \ OUTPUT_VARIABLE \ PRIVATE + \ PROJECT + \ RESULTVAR \ SOURCES + \ SOURCE_DIR + \ SOURCE_FROM_CONTENT + \ SOURCE_FROM_FILE + \ SOURCE_FROM_VAR \ STATIC_LIBRARY \ STATIC_LIBRARY_OPTIONS + \ TARGET \ TRUE \ TYPE \ VALUE @@ -3738,18 +4358,28 @@ syn keyword cmakeKWtry_run contained \ CMAKE_FLAGS \ COMPILE_DEFINITIONS \ COMPILE_OUTPUT_VARIABLE - \ DLINK_LIBRARIES - \ DVAR + \ COPY_FILE + \ COPY_FILE_ERROR \ FAILED_TO_RUN \ FALSE - \ INCLUDE_DIRECTORIES - \ LINK_DIRECTORIES + \ LANG \ LINK_LIBRARIES \ LINK_OPTIONS + \ LOG_DESCRIPTION + \ NO_CACHE + \ NO_LOG + \ RUN_OUTPUT_STDERR_VARIABLE + \ RUN_OUTPUT_STDOUT_VARIABLE \ RUN_OUTPUT_VARIABLE + \ SOURCES + \ SOURCE_FROM_CONTENT + \ SOURCE_FROM_FILE + \ SOURCE_FROM_VAR \ TRUE - \ TYPE - \ VALUE + \ WORKING_DIRECTORY + \ _EXTENSIONS + \ _STANDARD + \ _STANDARD_REQUIRED \ __TRYRUN_OUTPUT syn keyword cmakeKWunset contained @@ -3783,26 +4413,38 @@ syn keyword cmakeKWwrite_file contained syn keyword cmakeGeneratorExpressions contained - \ AND + \ ABSOLUTE_PATH + \ ACTION + \ AIX \ ANGLE + \ APPEND \ ARCHIVE_OUTPUT_NAME \ ARCHIVE_OUTPUT_NAME_ + \ ASCENDING \ BAR \ BOOL \ BUILD_INTERFACE - \ CMAKE_ - \ COMMA - \ COMMAND + \ BUILD_LOCAL_INTERFACE + \ CMAKE_LINK_GROUP_USING_ + \ CMAKE_LINK_LIBRARY_USING_ + \ CMAKE_PATH + \ CODE + \ COMMAND_CONFIG + \ COMMAND_EXPAND_LISTS + \ COMPARE \ COMPILE_DEFINITIONS \ COMPILE_FEATURES \ COMPILE_LANGUAGE \ COMPILE_LANG_AND_ID + \ COMPILE_ONLY \ COMPILING_CUDA + \ COMPILING_CXX \ COMPILING_CXX_WITH_CLANG \ COMPILING_CXX_WITH_INTEL \ COMPILING_C_WITH_CLANG \ CONFIG \ CONFIGURATION + \ CONTENT \ CUDA_COMPILER_ID \ CUDA_COMPILER_VERSION \ CUDA_RESOLVE_DEVICE_SYMBOLS @@ -3817,71 +4459,146 @@ syn keyword cmakeGeneratorExpressions contained \ C_STANDARD \ DEBUG_MODE \ DEBUG_POSTFIX + \ DENABLE_SOME_FEATURE + \ DESCENDING \ DEVICE_LINK \ DLL + \ ENABLE_EXPORTS \ EXCLUDE \ EXPORT + \ EXTENSION_DEF \ FALSE + \ FILENAME_DEF + \ FILE_BASENAME \ FILTER + \ FIND \ FOO_EXTRA_THINGS \ GENERATE \ GENEX_EVAL - \ GNU + \ GET_EXTENSION + \ GET_FILENAME + \ GET_PARENT_PATH + \ GET_RELATIVE_PART + \ GET_ROOT_DIRECTORY + \ GET_ROOT_NAME + \ GET_ROOT_PATH + \ GET_STEM + \ HAS_ + \ HAS_EXTENSION + \ HAS_FILENAME + \ HAS_PARENT_PATH + \ HAS_RELATIVE_PART + \ HAS_ROOT_DIRECTORY + \ HAS_ROOT_NAME + \ HAS_ROOT_PATH + \ HAS_STEM + \ HAVE_SOME_FEATURE \ HIP_COMPILER_ID \ HIP_COMPILER_VERSION \ HIP_STANDARD \ HOST_LINK \ IF \ IGNORE + \ IMPORTED_LOCATION \ IMPORT_PREFIX \ IMPORT_SUFFIX \ INCLUDE_DIRECTORIES + \ INSENSITIVE + \ INSERT \ INSTALL_INTERFACE \ INSTALL_NAME_DIR \ INSTALL_PREFIX - \ INTERFACE + \ INSTALL_RPATH \ INTERFACE_LINK_LIBRARIES + \ INTERFACE_LINK_LIBRARIES_DIRECT \ IN_LIST \ ISPC_COMPILER_ID \ ISPC_COMPILER_VERSION + \ IS_ABSOLUTE + \ IS_PREFIX + \ IS_RELATIVE \ JOIN \ LANG \ LANG_COMPILER_ID + \ LAST_ONLY + \ LENGTH \ LIBRARY_OUTPUT_NAME \ LIBRARY_OUTPUT_NAME_ + \ LINK_GROUP + \ LINK_GROUP_PREDEFINED_FEATURES \ LINK_LANGUAGE \ LINK_LANG_AND_ID \ LINK_LIBRARIES + \ LINK_LIBRARY + \ LINK_LIBRARY_OVERRIDE + \ LINK_LIBRARY_OVERRIDE_ + \ LINK_LIBRARY_PREDEFINED_FEATURES \ LINK_ONLY \ LOWER_CASE \ MAKE_C_IDENTIFIER \ MAP_IMPORTED_CONFIG_ + \ MODULE + \ NATURAL \ NO + \ NORMALIZE + \ NORMAL_PATH \ NOT \ OBJCXX_COMPILER_ID \ OBJCXX_COMPILER_VERSION \ OBJC_COMPILER_ID \ OBJC_COMPILER_VERSION + \ OBJECT \ OFF \ OLD_COMPILER + \ ORDER + \ OUTPUT + \ OUTPUT_CONFIG \ OUTPUT_NAME \ OUTPUT_NAME_ + \ PATH + \ PATH_EQUAL \ PDB_NAME \ PDB_NAME_ \ PDB_OUTPUT_DIRECTORY \ PDB_OUTPUT_DIRECTORY_ \ PLATFORM_ID + \ POP_BACK + \ POP_FRONT \ POSIX + \ POST_BUILD + \ PREPEND \ PRIVATE \ PUBLIC + \ REGEX + \ RELATIVE_PATH + \ REMOVE_AT \ REMOVE_DUPLICATES + \ REMOVE_EXTENSION + \ REMOVE_FILENAME + \ REMOVE_ITEM + \ REPLACE + \ REPLACE_EXTENSION + \ REPLACE_FILENAME + \ REQUIRED + \ RESCAN + \ REVERSE + \ RPATH + \ RUNTIME_DEPENDENCY_SET \ RUNTIME_OUTPUT_NAME \ RUNTIME_OUTPUT_NAME_ + \ SCRIPT \ SDK + \ SELECTOR \ SEMICOLON + \ SENSITIVE + \ SHARED \ SHELL_PATH + \ SORT \ STATIC \ STREQUAL + \ STRING + \ STRIP + \ SUBLIST \ TARGET_BUNDLE_CONTENT_DIR \ TARGET_BUNDLE_DIR \ TARGET_BUNDLE_DIR_NAME @@ -3893,12 +4610,30 @@ syn keyword cmakeGeneratorExpressions contained \ TARGET_FILE_PREFIX \ TARGET_FILE_SUFFIX \ TARGET_GENEX_EVAL + \ TARGET_IMPORT_FILE + \ TARGET_IMPORT_FILE_BASE_NAME + \ TARGET_IMPORT_FILE_DIR + \ TARGET_IMPORT_FILE_NAME + \ TARGET_IMPORT_FILE_PREFIX + \ TARGET_IMPORT_FILE_SUFFIX \ TARGET_LINKER_FILE \ TARGET_LINKER_FILE_BASE_NAME \ TARGET_LINKER_FILE_DIR \ TARGET_LINKER_FILE_NAME \ TARGET_LINKER_FILE_PREFIX \ TARGET_LINKER_FILE_SUFFIX + \ TARGET_LINKER_IMPORT_FILE + \ TARGET_LINKER_IMPORT_FILE_BASE_NAME + \ TARGET_LINKER_IMPORT_FILE_DIR + \ TARGET_LINKER_IMPORT_FILE_NAME + \ TARGET_LINKER_IMPORT_FILE_PREFIX + \ TARGET_LINKER_IMPORT_FILE_SUFFIX + \ TARGET_LINKER_LIBRARY_FILE + \ TARGET_LINKER_LIBRARY_FILE_BASE_NAME + \ TARGET_LINKER_LIBRARY_FILE_DIR + \ TARGET_LINKER_LIBRARY_FILE_NAME + \ TARGET_LINKER_LIBRARY_FILE_PREFIX + \ TARGET_LINKER_LIBRARY_FILE_SUFFIX \ TARGET_NAME_IF_EXISTS \ TARGET_OBJECTS \ TARGET_PDB_FILE @@ -3907,16 +4642,34 @@ syn keyword cmakeGeneratorExpressions contained \ TARGET_PDB_FILE_NAME \ TARGET_POLICY \ TARGET_PROPERTY + \ TARGET_RUNTIME_DLLS + \ TARGET_RUNTIME_DLL_DIRS \ TARGET_SONAME_FILE \ TARGET_SONAME_FILE_DIR \ TARGET_SONAME_FILE_NAME + \ TARGET_SONAME_IMPORT_FILE + \ TARGET_SONAME_IMPORT_FILE_DIR + \ TARGET_SONAME_IMPORT_FILE_NAME + \ TOLOWER + \ TOUPPER + \ TRANSFORM + \ TRANSFORM_APPEND + \ TRANSFORM_REPLACE + \ TRANSFORM_STRIP + \ TRANSFORM_TOLOWER + \ UNKNOWN \ UPPER_CASE + \ VERBATIM \ VERSION_EQUAL - \ VERSION_GREATER \ VERSION_GREATER_EQUAL \ VERSION_LESS \ VERSION_LESS_EQUAL + \ WHOLE_ARCHIVE + \ WRONG + \ _LINK_GROUP_USING_ + \ _LINK_LIBRARY_USING_ \ _POSTFIX + \ _SUPPORTED syn case ignore @@ -3936,6 +4689,7 @@ syn keyword cmakeCommand \ block \ break \ build_command + \ cmake_file_api \ cmake_host_system_information \ cmake_language \ cmake_minimum_required @@ -4085,6 +4839,7 @@ hi def link cmakeVariableValue Type hi def link cmakeVariable Identifier hi def link cmakeKWExternalProject ModeMsg +hi def link cmakeKWFetchContent ModeMsg hi def link cmakeKWadd_compile_definitions ModeMsg hi def link cmakeKWadd_compile_options ModeMsg hi def link cmakeKWadd_custom_command ModeMsg @@ -4096,7 +4851,9 @@ hi def link cmakeKWadd_library ModeMsg hi def link cmakeKWadd_link_options ModeMsg hi def link cmakeKWadd_subdirectory ModeMsg hi def link cmakeKWadd_test ModeMsg +hi def link cmakeKWblock ModeMsg hi def link cmakeKWbuild_command ModeMsg +hi def link cmakeKWcmake_file_api ModeMsg hi def link cmakeKWcmake_host_system_information ModeMsg hi def link cmakeKWcmake_language ModeMsg hi def link cmakeKWcmake_minimum_required ModeMsg diff --git a/CMakeLists.txt b/CMakeLists.txt index d559c08..2823ca4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. -cmake_minimum_required(VERSION 3.13...3.25 FATAL_ERROR) +cmake_minimum_required(VERSION 3.13...3.26 FATAL_ERROR) set(CMAKE_USER_MAKE_RULES_OVERRIDE_C ${CMAKE_CURRENT_SOURCE_DIR}/Source/Modules/OverrideC.cmake) set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX ${CMAKE_CURRENT_SOURCE_DIR}/Source/Modules/OverrideCXX.cmake) @@ -131,6 +131,8 @@ if(CMake_BUILD_LTO) endif() endif() +option(CMake_BUILD_PCH "Compile CMake with precompiled headers" OFF) + # Check whether to build support for the debugger mode. if(NOT CMake_TEST_EXTERNAL_CMAKE) if(NOT DEFINED CMake_ENABLE_DEBUGGER) @@ -153,7 +155,6 @@ endif() # simply to improve readability of the main script #----------------------------------------------------------------------- macro(CMAKE_HANDLE_SYSTEM_LIBRARIES) - # Options have dependencies. include(CMakeDependentOption) # Allow the user to enable/disable all system utility library options by @@ -324,6 +325,9 @@ configure_file(.clang-tidy .clang-tidy COPYONLY) option(CMake_RUN_IWYU "Run include-what-you-use with the compiler." OFF) if(CMake_RUN_IWYU) + if(CMake_BUILD_PCH) + message(FATAL_ERROR "CMake_RUN_IWYU and CMake_BUILD_PCH are ON, but they are incompatible!") + endif() find_program(IWYU_COMMAND NAMES include-what-you-use iwyu) if(NOT IWYU_COMMAND) message(FATAL_ERROR "CMake_RUN_IWYU is ON but include-what-you-use is not found!") diff --git a/Help/command/add_custom_command.rst b/Help/command/add_custom_command.rst index f1be309..c305cc2 100644 --- a/Help/command/add_custom_command.rst +++ b/Help/command/add_custom_command.rst @@ -24,6 +24,7 @@ The first signature is for adding a custom command to produce an output: [COMMENT comment] [DEPFILE depfile] [JOB_POOL job_pool] + [JOB_SERVER_AWARE <bool>] [VERBATIM] [APPEND] [USES_TERMINAL] [COMMAND_EXPAND_LISTS] [DEPENDS_EXPLICIT_ONLY]) @@ -221,6 +222,19 @@ The options are: Using a pool that is not defined by :prop_gbl:`JOB_POOLS` causes an error by ninja at build time. +``JOB_SERVER_AWARE`` + .. versionadded:: 3.28 + + Specify that the command is GNU Make job server aware. + + For the :generator:`Unix Makefiles`, :generator:`MSYS Makefiles`, and + :generator:`MinGW Makefiles` generators this will add the ``+`` prefix to the + recipe line. See the `GNU Make Documentation`_ for more information. + + This option is silently ignored by other generators. + +.. _`GNU Make Documentation`: https://www.gnu.org/software/make/manual/html_node/MAKE-Variable.html + ``MAIN_DEPENDENCY`` Specify the primary input source file to the command. This is treated just like any value given to the ``DEPENDS`` option @@ -512,7 +526,7 @@ one of the keywords to make clear the behavior they expect. Because generator expressions can be used in custom commands, it is possible to define ``COMMAND`` lines or whole custom commands which evaluate to empty strings for certain configurations. - For **Visual Studio 11 2012 (and newer)** generators these command + For **Visual Studio 12 2013 (and newer)** generators these command lines or custom commands will be omitted for the specific configuration and no "empty-string-command" will be added. diff --git a/Help/command/add_custom_target.rst b/Help/command/add_custom_target.rst index 545b9a5..ef0c8d9 100644 --- a/Help/command/add_custom_target.rst +++ b/Help/command/add_custom_target.rst @@ -12,6 +12,7 @@ Add a target with no output so it will always be built. [WORKING_DIRECTORY dir] [COMMENT comment] [JOB_POOL job_pool] + [JOB_SERVER_AWARE <bool>] [VERBATIM] [USES_TERMINAL] [COMMAND_EXPAND_LISTS] [SOURCES src1 [src2...]]) @@ -146,6 +147,19 @@ The options are: Using a pool that is not defined by :prop_gbl:`JOB_POOLS` causes an error by ninja at build time. +``JOB_SERVER_AWARE`` + .. versionadded:: 3.28 + + Specify that the command is GNU Make job server aware. + + For the :generator:`Unix Makefiles`, :generator:`MSYS Makefiles`, and + :generator:`MinGW Makefiles` generators this will add the ``+`` prefix to the + recipe line. See the `GNU Make Documentation`_ for more information. + + This option is silently ignored by other generators. + +.. _`GNU Make Documentation`: https://www.gnu.org/software/make/manual/html_node/MAKE-Variable.html + ``SOURCES`` Specify additional source files to be included in the custom target. Specified source files will be added to IDE project files for diff --git a/Help/command/file.rst b/Help/command/file.rst index 30a7f4d..f9d1a79 100644 --- a/Help/command/file.rst +++ b/Help/command/file.rst @@ -981,6 +981,11 @@ Path Conversion if ``USERPROFILE`` is not defined. On all other platforms, only ``HOME`` is used. + .. versionchanged:: 3.28 + + All symlinks are resolved before collapsing ``../`` components. + See policy :policy:`CMP0152`. + .. signature:: file(RELATIVE_PATH <variable> <directory> <file>) diff --git a/Help/dev/experimental.rst b/Help/dev/experimental.rst index eac86ab..7328d7b 100644 --- a/Help/dev/experimental.rst +++ b/Help/dev/experimental.rst @@ -18,7 +18,7 @@ C++20 Module APIs ================= Variable: ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` -Value: ``aa1f7df0-828a-4fcd-9afc-2dc80491aca7`` +Value: ``bf70d4b0-9fb7-465c-9803-34014e70d112`` In order to support C++20 modules, there are a number of behaviors that have CMake APIs to provide the required features to build and export them from a diff --git a/Help/envvar/CMAKE_CROSSCOMPILING_EMULATOR.rst b/Help/envvar/CMAKE_CROSSCOMPILING_EMULATOR.rst new file mode 100644 index 0000000..3e397d8 --- /dev/null +++ b/Help/envvar/CMAKE_CROSSCOMPILING_EMULATOR.rst @@ -0,0 +1,11 @@ +CMAKE_CROSSCOMPILING_EMULATOR +----------------------------- + +.. versionadded:: 3.28 + +.. include:: ENV_VAR.txt + +The default value for :variable:`CMAKE_CROSSCOMPILING_EMULATOR` when there +is no explicit configuration given on the first run while creating a new +build tree. On later runs in an existing build tree the value persists in +the cache as :variable:`CMAKE_CROSSCOMPILING_EMULATOR`. diff --git a/Help/generator/Visual Studio 10 2010.rst b/Help/generator/Visual Studio 10 2010.rst index 888164f..a36046a 100644 --- a/Help/generator/Visual Studio 10 2010.rst +++ b/Help/generator/Visual Studio 10 2010.rst @@ -3,6 +3,6 @@ Visual Studio 10 2010 Removed. This once generated Visual Studio 10 2010 project files, but the generator has been removed since CMake 3.25. It is still possible -to build with VS 10 2010 tools using the :generator:`Visual Studio 12 2013` +to build with VS 10 2010 tools using the :generator:`Visual Studio 14 2015` (or above) generator with :variable:`CMAKE_GENERATOR_TOOLSET` set to ``v100``, or by using the :generator:`NMake Makefiles` generator. diff --git a/Help/generator/Visual Studio 11 2012.rst b/Help/generator/Visual Studio 11 2012.rst index 4e7195c..5ded24c 100644 --- a/Help/generator/Visual Studio 11 2012.rst +++ b/Help/generator/Visual Studio 11 2012.rst @@ -1,57 +1,8 @@ Visual Studio 11 2012 --------------------- -Deprecated. Generates Visual Studio 11 (VS 2012) project files. - -.. note:: - This generator is deprecated and will be removed in a future version - of CMake. It will still be possible to build with VS 11 2012 tools - using the :generator:`Visual Studio 12 2013` (or above) generator - with :variable:`CMAKE_GENERATOR_TOOLSET` set to ``v110``, or by - using the :generator:`NMake Makefiles` generator. - -For compatibility with CMake versions prior to 3.0, one may specify this -generator using the name "Visual Studio 11" without the year component. - -Project Types -^^^^^^^^^^^^^ - -Only Visual C++ and C# projects may be generated (and Fortran with -Intel compiler integration). Other types of projects (JavaScript, -Database, Website, etc.) are not supported. - -Platform Selection -^^^^^^^^^^^^^^^^^^ - -The default target platform name (architecture) is ``Win32``. - -.. versionadded:: 3.1 - The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps - via the :option:`cmake -A` option, to specify a target platform - name (architecture). For example: - - * ``cmake -G "Visual Studio 11 2012" -A Win32`` - * ``cmake -G "Visual Studio 11 2012" -A x64`` - * ``cmake -G "Visual Studio 11 2012" -A ARM`` - * ``cmake -G "Visual Studio 11 2012" -A <WinCE-SDK>`` - (Specify a target platform matching a Windows CE SDK name.) - -For compatibility with CMake versions prior to 3.1, one may specify -a target platform name optionally at the end of the generator name. -This is supported only for: - -``Visual Studio 11 2012 Win64`` - Specify target platform ``x64``. - -``Visual Studio 11 2012 ARM`` - Specify target platform ``ARM``. - -``Visual Studio 11 2012 <WinCE-SDK>`` - Specify target platform matching a Windows CE SDK name. - -Toolset Selection -^^^^^^^^^^^^^^^^^ - -The ``v110`` toolset that comes with Visual Studio 11 2012 is selected by -default. The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps -via the :option:`cmake -T` option, to specify another toolset. +Removed. This once generated Visual Studio 11 2012 project files, but +the generator has been removed since CMake 3.28. It is still possible +to build with VS 11 2012 tools using the :generator:`Visual Studio 14 2015` +(or above) generator with :variable:`CMAKE_GENERATOR_TOOLSET` set to ``v110``, +or by using the :generator:`NMake Makefiles` generator. diff --git a/Help/generator/Visual Studio 12 2013.rst b/Help/generator/Visual Studio 12 2013.rst index 3dbcfe6..522522c 100644 --- a/Help/generator/Visual Studio 12 2013.rst +++ b/Help/generator/Visual Studio 12 2013.rst @@ -1,7 +1,14 @@ Visual Studio 12 2013 --------------------- -Generates Visual Studio 12 (VS 2013) project files. +Deprecated. Generates Visual Studio 12 (VS 2013) project files. + +.. note:: + This generator is deprecated and will be removed in a future version + of CMake. It will still be possible to build with VS 12 2013 tools + using the :generator:`Visual Studio 14 2015` (or above) generator + with :variable:`CMAKE_GENERATOR_TOOLSET` set to ``v120``, or by + using the :generator:`NMake Makefiles` generator. For compatibility with CMake versions prior to 3.0, one may specify this generator using the name "Visual Studio 12" without the year component. diff --git a/Help/generator/Visual Studio 9 2008.rst b/Help/generator/Visual Studio 9 2008.rst index 816969d..1439270 100644 --- a/Help/generator/Visual Studio 9 2008.rst +++ b/Help/generator/Visual Studio 9 2008.rst @@ -6,7 +6,7 @@ Deprecated. Generates Visual Studio 9 2008 project files. .. note:: This generator is deprecated and will be removed in a future version of CMake. It will still be possible to build with VS 9 2008 tools - using the :generator:`Visual Studio 12 2013` generator (or above, + using the :generator:`Visual Studio 14 2015` generator (or above, and with VS 10 2010 also installed) with :variable:`CMAKE_GENERATOR_TOOLSET` set to ``v90``, or by using the :generator:`NMake Makefiles` generator. diff --git a/Help/guide/tutorial/Adding Generator Expressions.rst b/Help/guide/tutorial/Adding Generator Expressions.rst index 3dab97f..910eacb 100644 --- a/Help/guide/tutorial/Adding Generator Expressions.rst +++ b/Help/guide/tutorial/Adding Generator Expressions.rst @@ -149,8 +149,8 @@ interface library. Lastly, we only want these warning flags to be used during builds. Consumers of our installed project should not inherit our warning flags. To specify -this, we wrap our flags in a generator expression using the ``BUILD_INTERFACE`` -condition. The resulting full code looks like the following: +this, we wrap our flags from TODO 3 in a generator expression using the +``BUILD_INTERFACE`` condition. The resulting full code looks like the following: .. raw:: html diff --git a/Help/guide/tutorial/Adding Usage Requirements for a Library.rst b/Help/guide/tutorial/Adding Usage Requirements for a Library.rst index 2273063..5e803f5 100644 --- a/Help/guide/tutorial/Adding Usage Requirements for a Library.rst +++ b/Help/guide/tutorial/Adding Usage Requirements for a Library.rst @@ -127,7 +127,7 @@ Remove this line: </details> -And the lines: +And remove ``EXTRA_INCLUDES`` from ``target_include_directories``: .. raw:: html @@ -143,23 +143,6 @@ And the lines: </details> -The remaining code looks like: - -.. raw:: html - - <details><summary>Click to show/hide the resulting code</summary> - -.. literalinclude:: Step4/CMakeLists.txt - :caption: Remaining code after removing EXTRA_INCLUDES - :name: CMakeLists.txt-after-removing-EXTRA_INCLUDES - :language: cmake - :start-after: add_subdirectory(MathFunctions) - -.. raw:: html - - </details> - - Notice that with this technique, the only thing our executable target does to use our library is call :command:`target_link_libraries` with the name of the library target. In larger projects, the classic method of specifying @@ -309,8 +292,8 @@ and this: :caption: TODO 7: MathFunctions/CMakeLists.txt :name: MathFunctions-SqrtLibrary-target_link_libraries-step4 :language: cmake - :start-after: target_link_libraries(SqrtLibrary - :end-before: endif() + :start-after: # link our compiler flags interface library + :end-before: target_link_libraries(MathFunctions PUBLIC SqrtLibrary) .. raw:: html diff --git a/Help/guide/tutorial/Adding a Library.rst b/Help/guide/tutorial/Adding a Library.rst index 694dfaf..178334a 100644 --- a/Help/guide/tutorial/Adding a Library.rst +++ b/Help/guide/tutorial/Adding a Library.rst @@ -96,7 +96,7 @@ a library target called ``MathFunctions`` with :command:`add_library`. The source files for the library are passed as an argument to :command:`add_library`. This looks like the following line: -.. raw:: html/ +.. raw:: html <details><summary>TODO 1: Click to show/hide answer</summary> diff --git a/Help/guide/tutorial/Selecting Static or Shared Libraries.rst b/Help/guide/tutorial/Selecting Static or Shared Libraries.rst index 504e42f..a2f5e2a 100644 --- a/Help/guide/tutorial/Selecting Static or Shared Libraries.rst +++ b/Help/guide/tutorial/Selecting Static or Shared Libraries.rst @@ -44,7 +44,18 @@ SqrtLibrary to be ``True`` when building shared libraries. :caption: MathFunctions/CMakeLists.txt :name: MathFunctions/CMakeLists.txt-POSITION_INDEPENDENT_CODE :language: cmake - :lines: 37-42 + :start-at: # state that SqrtLibrary need PIC when the default is shared libraries + :end-at: ) + +Define ``EXPORTING_MYMATH`` stating we are using ``declspec(dllexport)`` when +building on Windows. + +.. literalinclude:: Step11/MathFunctions/CMakeLists.txt + :caption: MathFunctions/CMakeLists.txt + :name: MathFunctions/CMakeLists.txt-dll-export + :language: cmake + :start-at: # define the symbol stating we are using the declspec(dllexport) when + :end-at: target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH") **Exercise**: We modified ``MathFunctions.h`` to use dll export defines. Using CMake documentation can you find a helper module to simplify this? diff --git a/Help/manual/cmake-env-variables.7.rst b/Help/manual/cmake-env-variables.7.rst index 197e56e..356e73d 100644 --- a/Help/manual/cmake-env-variables.7.rst +++ b/Help/manual/cmake-env-variables.7.rst @@ -43,6 +43,7 @@ Environment Variables that Control the Build /envvar/CMAKE_COLOR_DIAGNOSTICS /envvar/CMAKE_CONFIGURATION_TYPES /envvar/CMAKE_CONFIG_TYPE + /envvar/CMAKE_CROSSCOMPILING_EMULATOR /envvar/CMAKE_EXPORT_COMPILE_COMMANDS /envvar/CMAKE_GENERATOR /envvar/CMAKE_GENERATOR_INSTANCE diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst index 7c48806..89b7924 100644 --- a/Help/manual/cmake-policies.7.rst +++ b/Help/manual/cmake-policies.7.rst @@ -51,6 +51,14 @@ The :variable:`CMAKE_MINIMUM_REQUIRED_VERSION` variable may also be used to determine whether to report an error on use of deprecated macros or functions. +Policies Introduced by CMake 3.28 +================================= + +.. toctree:: + :maxdepth: 1 + + CMP0152: file(REAL_PATH) resolves symlinks before collapsing ../ components. </policy/CMP0152> + Policies Introduced by CMake 3.27 ================================= diff --git a/Help/manual/cmake-toolchains.7.rst b/Help/manual/cmake-toolchains.7.rst index a831fa6..e32bd29 100644 --- a/Help/manual/cmake-toolchains.7.rst +++ b/Help/manual/cmake-toolchains.7.rst @@ -573,12 +573,12 @@ See also target properties: * :prop_tgt:`ANDROID_SKIP_ANT_STEP` * :prop_tgt:`ANDROID_STL_TYPE` -.. _`Cross Compiling for iOS, tvOS, or watchOS`: +.. _`Cross Compiling for iOS, tvOS, visionOS, or watchOS`: -Cross Compiling for iOS, tvOS, or watchOS ------------------------------------------ +Cross Compiling for iOS, tvOS, visionOS, or watchOS +--------------------------------------------------- -For cross-compiling to iOS, tvOS, or watchOS, the :generator:`Xcode` +For cross-compiling to iOS, tvOS, visionOS, or watchOS, the :generator:`Xcode` generator is recommended. The :generator:`Unix Makefiles` or :generator:`Ninja` generators can also be used, but they require the project to handle more areas like target CPU selection and code signing. @@ -591,13 +591,14 @@ a different SDK (e.g. a simulator) can be selected by setting the necessary (see :ref:`Switching Between Device and Simulator` below). A list of available SDKs can be obtained by running ``xcodebuild -showsdks``. -======= ================= ==================== ================ -OS CMAKE_SYSTEM_NAME Device SDK (default) Simulator SDK -======= ================= ==================== ================ -iOS iOS iphoneos iphonesimulator -tvOS tvOS appletvos appletvsimulator -watchOS watchOS watchos watchsimulator -======= ================= ==================== ================ +======== ================= ==================== ================ +OS CMAKE_SYSTEM_NAME Device SDK (default) Simulator SDK +======== ================= ==================== ================ +iOS iOS iphoneos iphonesimulator +tvOS tvOS appletvos appletvsimulator +visionOS visionOS xros xrsimulator +watchOS watchOS watchos watchsimulator +======== ================= ==================== ================ For example, to create a CMake configuration for iOS, the following command is sufficient: @@ -608,7 +609,7 @@ command is sufficient: Variable :variable:`CMAKE_OSX_ARCHITECTURES` can be used to set architectures for both device and simulator. Variable :variable:`CMAKE_OSX_DEPLOYMENT_TARGET` -can be used to set an iOS/tvOS/watchOS deployment target. +can be used to set an iOS/tvOS/visionOS/watchOS deployment target. Next configuration will install fat 5 architectures iOS library and add the ``-miphoneos-version-min=9.3``/``-mios-simulator-version-min=9.3`` diff --git a/Help/policy/CMP0152.rst b/Help/policy/CMP0152.rst new file mode 100644 index 0000000..d7e8692 --- /dev/null +++ b/Help/policy/CMP0152.rst @@ -0,0 +1,20 @@ +CMP0152 +------- + +.. versionadded:: 3.28 + +:command:`file(REAL_PATH)` resolves symlinks before collapsing ../ components. + +In CMake 3.27 and below, :command:`file(REAL_PATH)` collapsed any ``../`` +components in a path before resolving symlinks. This produced incorrect +results when the ``../`` collapsed away a symlink. + +The ``OLD`` behavior for this policy is to collapse ``../`` components before +resolving symlinks. +The ``NEW`` behavior for this policy is to resolve all symlinks before +collapsing ``../`` components. + +This policy was introduced in CMake version 3.28. Use the +:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly. + +.. include:: DEPRECATED.txt diff --git a/Help/prop_gbl/XCODE_EMIT_EFFECTIVE_PLATFORM_NAME.rst b/Help/prop_gbl/XCODE_EMIT_EFFECTIVE_PLATFORM_NAME.rst index 392b704..6794a26 100644 --- a/Help/prop_gbl/XCODE_EMIT_EFFECTIVE_PLATFORM_NAME.rst +++ b/Help/prop_gbl/XCODE_EMIT_EFFECTIVE_PLATFORM_NAME.rst @@ -16,8 +16,8 @@ generator emits the ``EFFECTIVE_PLATFORM_NAME`` variable: - If set to ``ON`` it will always be emitted - If set to ``OFF`` it will never be emitted - If unset (the default) it will only be emitted when the project was - configured for an embedded Xcode SDK like iOS, tvOS, watchOS or any - of the simulators. + configured for an embedded Xcode SDK like iOS, tvOS, visionOS, watchOS + or any of the simulators. .. note:: diff --git a/Help/prop_tgt/IMPORTED_IMPLIB.rst b/Help/prop_tgt/IMPORTED_IMPLIB.rst index e67acba..27601d2 100644 --- a/Help/prop_tgt/IMPORTED_IMPLIB.rst +++ b/Help/prop_tgt/IMPORTED_IMPLIB.rst @@ -11,6 +11,12 @@ This property may be set: * On macOS, to an import file (e.g. ``.tbd``) created for shared libraries (see the :prop_tgt:`ENABLE_EXPORTS` target property). For frameworks this is the location of the ``.tbd`` file symlink just inside the framework folder. +* .. versionadded:: 3.28 + On non-DLL platforms, to the location of a shared library. + When set without also specifying an :prop_tgt:`IMPORTED_LOCATION`, + the library is considered to be a stub, and its location will not + be added as a runtime search path to dependents that link it. + The ``IMPORTED_IMPLIB`` target property may be overridden for a given configuration ``<CONFIG>`` by the configuration-specific diff --git a/Help/prop_tgt/IMPORTED_LOCATION.rst b/Help/prop_tgt/IMPORTED_LOCATION.rst index a7207d8..50c3658 100644 --- a/Help/prop_tgt/IMPORTED_LOCATION.rst +++ b/Help/prop_tgt/IMPORTED_LOCATION.rst @@ -15,6 +15,11 @@ is the location of the ``.dll`` part of the library. For ``UNKNOWN`` libraries this is the location of the file to be linked. Ignored for non-imported targets. +.. versionadded:: 3.28 + + For frameworks on macOS, this may be the location of the framework folder + itself. + The ``IMPORTED_LOCATION`` target property may be overridden for a given configuration ``<CONFIG>`` by the configuration-specific :prop_tgt:`IMPORTED_LOCATION_<CONFIG>` target property. Furthermore, diff --git a/Help/prop_tgt/IMPORTED_OBJECTS.rst b/Help/prop_tgt/IMPORTED_OBJECTS.rst index d71c219..9aacea7 100644 --- a/Help/prop_tgt/IMPORTED_OBJECTS.rst +++ b/Help/prop_tgt/IMPORTED_OBJECTS.rst @@ -31,7 +31,7 @@ once per architecture for each source file. Unlike the other generators, it does not generate universal object file binaries. A further complication with the :generator:`Xcode` generator is that when -targeting device platforms (iOS, tvOS or watchOS), the :generator:`Xcode` +targeting device platforms (iOS, tvOS, visionOS or watchOS), the :generator:`Xcode` generator has the ability to use either the device or simulator SDK without needing CMake to be re-run. The SDK can be selected at build time. But since some architectures can be supported by both the device and the diff --git a/Help/prop_tgt/IOS_INSTALL_COMBINED.rst b/Help/prop_tgt/IOS_INSTALL_COMBINED.rst index 92d60dc..c296691 100644 --- a/Help/prop_tgt/IOS_INSTALL_COMBINED.rst +++ b/Help/prop_tgt/IOS_INSTALL_COMBINED.rst @@ -2,18 +2,27 @@ IOS_INSTALL_COMBINED -------------------- .. versionadded:: 3.5 +.. deprecated:: 3.28 + + :prop_tgt:`IOS_INSTALL_COMBINED` was designed to make universal binaries + containing iOS/arm* device code paired with iOS Simulator/x86_64 code + (or similar for other Apple embedded platforms). Universal binaries can only + differentiate code based on CPU type, so this only made sense before the + days of arm64 macOS machines (i.e. iOS Simulator/arm64). Apple now + recommends xcframeworks, which contain multiple binaries for different + platforms, for this use case. Build a combined (device and simulator) target when installing. -When this property is set to set to false (which is the default) then it will +When this property is set to false, which is the default, then it will either be built with the device SDK or the simulator SDK depending on the SDK set. But if this property is set to true then the target will at install time -also be built for the corresponding SDK and combined into one library. +also be built for the other SDK and combined into one library. .. note:: - If a selected architecture is available for both: device SDK and simulator + If a selected architecture is available for both device SDK and simulator SDK it will be built for the SDK selected by :variable:`CMAKE_OSX_SYSROOT` - and removed from the corresponding SDK. + and removed from the other SDK. This feature requires at least Xcode version 6. diff --git a/Help/prop_tgt/VS_DEBUGGER_COMMAND.rst b/Help/prop_tgt/VS_DEBUGGER_COMMAND.rst index 5bf47a3..8c136f2 100644 --- a/Help/prop_tgt/VS_DEBUGGER_COMMAND.rst +++ b/Help/prop_tgt/VS_DEBUGGER_COMMAND.rst @@ -11,5 +11,5 @@ project file. This property is initialized by the value of the variable :variable:`CMAKE_VS_DEBUGGER_COMMAND` if it is set when a target is created. -This property only works for Visual Studio 11 2012 and above; +This property only works for Visual Studio 12 2013 and above; it is ignored on other generators. diff --git a/Help/prop_tgt/VS_DEBUGGER_COMMAND_ARGUMENTS.rst b/Help/prop_tgt/VS_DEBUGGER_COMMAND_ARGUMENTS.rst index 4b9dff7..2656826 100644 --- a/Help/prop_tgt/VS_DEBUGGER_COMMAND_ARGUMENTS.rst +++ b/Help/prop_tgt/VS_DEBUGGER_COMMAND_ARGUMENTS.rst @@ -11,5 +11,5 @@ project file. This property is initialized by the value of the variable :variable:`CMAKE_VS_DEBUGGER_COMMAND_ARGUMENTS` if it is set when a target is created. -This property only works for Visual Studio 11 2012 and above; +This property only works for Visual Studio 12 2013 and above; it is ignored on other generators. diff --git a/Help/prop_tgt/VS_DEBUGGER_ENVIRONMENT.rst b/Help/prop_tgt/VS_DEBUGGER_ENVIRONMENT.rst index 8373dbb..d78d594 100644 --- a/Help/prop_tgt/VS_DEBUGGER_ENVIRONMENT.rst +++ b/Help/prop_tgt/VS_DEBUGGER_ENVIRONMENT.rst @@ -11,5 +11,5 @@ project file. This property is initialized by the value of the variable :variable:`CMAKE_VS_DEBUGGER_ENVIRONMENT` if it is set when a target is created. -This property only works for Visual Studio 11 2012 and above; +This property only works for Visual Studio 12 2013 and above; it is ignored on other generators. diff --git a/Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst b/Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst index 3942047..1026dfa 100644 --- a/Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst +++ b/Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst @@ -11,5 +11,5 @@ project file. This property is initialized by the value of the variable :variable:`CMAKE_VS_DEBUGGER_WORKING_DIRECTORY` if it is set when a target is created. -This property only works for Visual Studio 11 2012 and above; +This property only works for Visual Studio 12 2013 and above; it is ignored on other generators. diff --git a/Help/prop_tgt/VS_DOTNET_STARTUP_OBJECT.rst b/Help/prop_tgt/VS_DOTNET_STARTUP_OBJECT.rst index 8a85ba4..eeb7dda 100644 --- a/Help/prop_tgt/VS_DOTNET_STARTUP_OBJECT.rst +++ b/Help/prop_tgt/VS_DOTNET_STARTUP_OBJECT.rst @@ -12,7 +12,7 @@ If the property is unset, Visual Studio uses the first matching than one ``Main()`` method is available in the current project, the property becomes mandatory for building the project. -This property only works for Visual Studio 11 2012 and above; +This property only works for Visual Studio 12 2013 and above; it is ignored on other generators. .. code-block:: cmake diff --git a/Help/prop_tgt/VS_KEYWORD.rst b/Help/prop_tgt/VS_KEYWORD.rst index 221b986..f04d109 100644 --- a/Help/prop_tgt/VS_KEYWORD.rst +++ b/Help/prop_tgt/VS_KEYWORD.rst @@ -7,4 +7,4 @@ Can be set to change the visual studio keyword, for example Qt integration works better if this is set to Qt4VSv1.0. Use the :prop_tgt:`VS_GLOBAL_KEYWORD` target property to set the -keyword for Visual Studio 11 (2012) and newer. +keyword for Visual Studio 12 (2013) and newer. diff --git a/Help/release/3.14.rst b/Help/release/3.14.rst index 8a9738c..5fedf7d 100644 --- a/Help/release/3.14.rst +++ b/Help/release/3.14.rst @@ -63,7 +63,8 @@ File-Based API Platforms --------- -* CMake now supports :ref:`Cross Compiling for iOS, tvOS, or watchOS` +* CMake now supports + :ref:`Cross Compiling for iOS, tvOS, or watchOS <Cross Compiling for iOS, tvOS, visionOS, or watchOS>` using simple toolchain files. Command-Line diff --git a/Help/release/dev/0-sample-topic.rst b/Help/release/dev/0-sample-topic.rst new file mode 100644 index 0000000..e4cc01e --- /dev/null +++ b/Help/release/dev/0-sample-topic.rst @@ -0,0 +1,7 @@ +0-sample-topic +-------------- + +* This is a sample release note for the change in a topic. + Developers should add similar notes for each topic branch + making a noteworthy change. Each document should be named + and titled to match the topic name to avoid merge conflicts. diff --git a/Help/release/dev/CMAKE_CROSSCOMPILING_EMULATOR-env-variable.rst b/Help/release/dev/CMAKE_CROSSCOMPILING_EMULATOR-env-variable.rst new file mode 100644 index 0000000..269e739 --- /dev/null +++ b/Help/release/dev/CMAKE_CROSSCOMPILING_EMULATOR-env-variable.rst @@ -0,0 +1,6 @@ +CMAKE_CROSSCOMPILING_EMULATOR-env-variable +------------------------------------------ + +* The :envvar:`CMAKE_CROSSCOMPILING_EMULATOR` environment variable + was added to initialize the :variable:`CMAKE_CROSSCOMPILING_EMULATOR` + cache variable. diff --git a/Help/release/dev/FindCURL-static.rst b/Help/release/dev/FindCURL-static.rst new file mode 100644 index 0000000..3c369d2 --- /dev/null +++ b/Help/release/dev/FindCURL-static.rst @@ -0,0 +1,5 @@ +FindCURL-static +--------------- + +* The :module:`FindCURL` module gained a ``CURL_USE_STATIC_LIBS`` hint + to select static libraries. diff --git a/Help/release/dev/FindEXPAT-static.rst b/Help/release/dev/FindEXPAT-static.rst new file mode 100644 index 0000000..8808ebd --- /dev/null +++ b/Help/release/dev/FindEXPAT-static.rst @@ -0,0 +1,5 @@ +FindEXPAT-static +---------------- + +* The :module:`FindEXPAT` module gained a ``EXPAT_USE_STATIC_LIBS`` hint + to select static libraries. diff --git a/Help/release/dev/apple-visionos.rst b/Help/release/dev/apple-visionos.rst new file mode 100644 index 0000000..db76248 --- /dev/null +++ b/Help/release/dev/apple-visionos.rst @@ -0,0 +1,7 @@ +apple-visionos +-------------- + +* CMake learned about Apple visionOS and its `xros` and `xrsimulator` SDKs. + Compiling for Apple visionOS can be requested by setting + :variable:`CMAKE_SYSTEM_NAME` to ``visionOS``. For more + information see :manual:`cmake-toolchains(7)`. diff --git a/Help/release/dev/command-job-server-aware.rst b/Help/release/dev/command-job-server-aware.rst new file mode 100644 index 0000000..224c739 --- /dev/null +++ b/Help/release/dev/command-job-server-aware.rst @@ -0,0 +1,5 @@ +command-job-server-aware +------------------------ + +* The :command:`add_custom_command` and :command:`add_custom_target` + commands gained a ``JOB_SERVER_AWARE`` option. diff --git a/Help/release/dev/deprecate-install-combined.rst b/Help/release/dev/deprecate-install-combined.rst new file mode 100644 index 0000000..12a0a43 --- /dev/null +++ b/Help/release/dev/deprecate-install-combined.rst @@ -0,0 +1,6 @@ +deprecate-install-combined +-------------------------- + +* The :prop_tgt:`IOS_INSTALL_COMBINED` target property and corresponding + :variable:`CMAKE_IOS_INSTALL_COMBINED` variable have been deprecated. + Their functionality does not make sense on Apple Silicon hosts. diff --git a/Help/release/dev/imported-implib-only.rst b/Help/release/dev/imported-implib-only.rst new file mode 100644 index 0000000..aa817b7 --- /dev/null +++ b/Help/release/dev/imported-implib-only.rst @@ -0,0 +1,7 @@ +imported-implib-only +-------------------- + +* On imported shared libraries, the :prop_tgt:`IMPORTED_IMPLIB` target + property may now be used without :prop_tgt:`IMPORTED_LOCATION`. + This can be used to represent a stub library whose location should not + be added as a runtime search path to dependents that link it. diff --git a/Help/release/dev/imported-target-framework-path.rst b/Help/release/dev/imported-target-framework-path.rst new file mode 100644 index 0000000..68c3431 --- /dev/null +++ b/Help/release/dev/imported-target-framework-path.rst @@ -0,0 +1,5 @@ +imported-target-framework-path +------------------------------ + +* The :prop_tgt:`IMPORTED_LOCATION` property of a macOS framework may now be + the location of the framework folder itself. diff --git a/Help/release/dev/remove-vs11-generator.rst b/Help/release/dev/remove-vs11-generator.rst new file mode 100644 index 0000000..971d679 --- /dev/null +++ b/Help/release/dev/remove-vs11-generator.rst @@ -0,0 +1,4 @@ +remove-vs11-generator +--------------------- + +* The :generator:`Visual Studio 11 2012` generator has been removed. diff --git a/Help/release/dev/vs12-deprecate.rst b/Help/release/dev/vs12-deprecate.rst new file mode 100644 index 0000000..23d7e2a --- /dev/null +++ b/Help/release/dev/vs12-deprecate.rst @@ -0,0 +1,5 @@ +vs12-deprecate +-------------- + +* The :generator:`Visual Studio 12 2013` generator is now deprecated + and will be removed in a future version of CMake. diff --git a/Help/release/index.rst b/Help/release/index.rst index fc1f744..3851b7e 100644 --- a/Help/release/index.rst +++ b/Help/release/index.rst @@ -7,6 +7,8 @@ CMake Release Notes This file should include the adjacent "dev.txt" file in development versions but not in release versions. +.. include:: dev.txt + Releases ======== diff --git a/Help/variable/APPLE.rst b/Help/variable/APPLE.rst index 810d5fc..e799397 100644 --- a/Help/variable/APPLE.rst +++ b/Help/variable/APPLE.rst @@ -2,4 +2,4 @@ APPLE ----- Set to ``True`` when the target system is an Apple platform -(macOS, iOS, tvOS or watchOS). +(macOS, iOS, tvOS, visionOS or watchOS). diff --git a/Help/variable/CMAKE_CFG_INTDIR.rst b/Help/variable/CMAKE_CFG_INTDIR.rst index 3a57659..3045d91 100644 --- a/Help/variable/CMAKE_CFG_INTDIR.rst +++ b/Help/variable/CMAKE_CFG_INTDIR.rst @@ -19,7 +19,7 @@ Example values: :: $(ConfigurationName) = Visual Studio 9 - $(Configuration) = Visual Studio 11 and above + $(Configuration) = Visual Studio 12 and above $(CONFIGURATION) = Xcode . = Make-based tools . = Ninja diff --git a/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst b/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst index e21b35d..1c3a26c 100644 --- a/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst +++ b/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst @@ -12,6 +12,10 @@ for the target system. Lists>`, then the first value is the command and remaining values are its arguments. +.. versionadded:: 3.28 + This variable can be initialized via an + :envvar:`CMAKE_CROSSCOMPILING_EMULATOR` environment variable. + The command will be used to run :command:`try_run` generated executables, which avoids manual population of the ``TryRunResults.cmake`` file. diff --git a/Help/variable/CMAKE_IOS_INSTALL_COMBINED.rst b/Help/variable/CMAKE_IOS_INSTALL_COMBINED.rst index cd7fd8d..0024ba9 100644 --- a/Help/variable/CMAKE_IOS_INSTALL_COMBINED.rst +++ b/Help/variable/CMAKE_IOS_INSTALL_COMBINED.rst @@ -2,6 +2,9 @@ CMAKE_IOS_INSTALL_COMBINED -------------------------- .. versionadded:: 3.5 +.. deprecated:: 3.28 + + This is deprecated because :prop_tgt:`IOS_INSTALL_COMBINED` is deprecated. Default value for :prop_tgt:`IOS_INSTALL_COMBINED` of targets. diff --git a/Help/variable/CMAKE_MACOSX_BUNDLE.rst b/Help/variable/CMAKE_MACOSX_BUNDLE.rst index 43ddff5..483c5b3 100644 --- a/Help/variable/CMAKE_MACOSX_BUNDLE.rst +++ b/Help/variable/CMAKE_MACOSX_BUNDLE.rst @@ -7,4 +7,4 @@ This variable is used to initialize the :prop_tgt:`MACOSX_BUNDLE` property on all the targets. See that target property for additional information. This variable is set to ``ON`` by default if :variable:`CMAKE_SYSTEM_NAME` -equals to :ref:`iOS, tvOS or watchOS <Cross Compiling for iOS, tvOS, or watchOS>`. +equals to :ref:`iOS, tvOS, visionOS or watchOS <Cross Compiling for iOS, tvOS, visionOS, or watchOS>`. diff --git a/Help/variable/CMAKE_OSX_VARIABLE.txt b/Help/variable/CMAKE_OSX_VARIABLE.txt index 5670980..962fcd3 100644 --- a/Help/variable/CMAKE_OSX_VARIABLE.txt +++ b/Help/variable/CMAKE_OSX_VARIABLE.txt @@ -7,6 +7,6 @@ remove it while initializing a cache entry of the same name) unless policy :policy:`CMP0126` is set to ``NEW``. Despite the ``OSX`` part in the variable name(s) they apply also to -other SDKs than macOS like iOS, tvOS, or watchOS. +other SDKs than macOS like iOS, tvOS, visionOS, or watchOS. This variable is ignored on platforms other than Apple. diff --git a/Help/variable/CMAKE_VS_DEVENV_COMMAND.rst b/Help/variable/CMAKE_VS_DEVENV_COMMAND.rst index 2bb97c4..155931f 100644 --- a/Help/variable/CMAKE_VS_DEVENV_COMMAND.rst +++ b/Help/variable/CMAKE_VS_DEVENV_COMMAND.rst @@ -10,5 +10,5 @@ This variable is not defined by other generators even if ``devenv.com`` is installed on the computer. The :variable:`CMAKE_VS_MSBUILD_COMMAND` is also provided for -:generator:`Visual Studio 11 2012` and above. +:generator:`Visual Studio 12 2013` and above. See also the :variable:`CMAKE_MAKE_PROGRAM` variable. diff --git a/Help/variable/CMAKE_VS_MSBUILD_COMMAND.rst b/Help/variable/CMAKE_VS_MSBUILD_COMMAND.rst index 8a521a3..96924d5 100644 --- a/Help/variable/CMAKE_VS_MSBUILD_COMMAND.rst +++ b/Help/variable/CMAKE_VS_MSBUILD_COMMAND.rst @@ -1,7 +1,7 @@ CMAKE_VS_MSBUILD_COMMAND ------------------------ -The generators for :generator:`Visual Studio 11 2012` and above set this +The generators for :generator:`Visual Studio 12 2013` and above set this variable to the ``MSBuild.exe`` command installed with the corresponding Visual Studio version. diff --git a/Modules/CMakeDetermineCSharpCompiler.cmake b/Modules/CMakeDetermineCSharpCompiler.cmake index fe98469..652eb63 100644 --- a/Modules/CMakeDetermineCSharpCompiler.cmake +++ b/Modules/CMakeDetermineCSharpCompiler.cmake @@ -3,7 +3,7 @@ if(NOT ${CMAKE_GENERATOR} MATCHES "Visual Studio ([^9]|[9][0-9])") message(FATAL_ERROR - "C# is currently only supported for Microsoft Visual Studio 11 2012 and later.") + "C# is currently only supported for Microsoft Visual Studio 12 2013 and later.") endif() include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake) diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 6c49096..4db9aa8 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -608,6 +608,7 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} if(CMAKE_OSX_SYSROOT) set(id_sdkroot "SDKROOT = \"${CMAKE_OSX_SYSROOT}\";") if(CMAKE_OSX_SYSROOT MATCHES "(^|/)[Ii][Pp][Hh][Oo][Nn][Ee]" OR + CMAKE_OSX_SYSROOT MATCHES "(^|/)[Xx][Rr]" OR CMAKE_OSX_SYSROOT MATCHES "(^|/)[Aa][Pp][Pp][Ll][Ee][Tt][Vv]") set(id_product_type "com.apple.product-type.bundle.unit-test") elseif(CMAKE_OSX_SYSROOT MATCHES "(^|/)[Ww][Aa][Tt][Cc][Hh]") diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake index 386be73..fff4e9d 100644 --- a/Modules/CMakeDetermineSystem.cmake +++ b/Modules/CMakeDetermineSystem.cmake @@ -47,6 +47,28 @@ if(CMAKE_HOST_UNIX) set(CMAKE_HOST_SYSTEM_VERSION "${_CMAKE_HOST_SYSTEM_MAJOR_VERSION}.${_CMAKE_HOST_SYSTEM_MINOR_VERSION}") unset(_CMAKE_HOST_SYSTEM_MAJOR_VERSION) unset(_CMAKE_HOST_SYSTEM_MINOR_VERSION) + elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Android") + execute_process(COMMAND getprop ro.build.version.sdk + OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_QUIET) + + if(NOT DEFINED CMAKE_SYSTEM_VERSION) + set(_ANDROID_API_LEVEL_H $ENV{PREFIX}/include/android/api-level.h) + set(_ANDROID_API_REGEX "#define __ANDROID_API__ ([0-9]+)") + file(READ ${_ANDROID_API_LEVEL_H} _ANDROID_API_LEVEL_H_CONTENT) + string(REGEX MATCH ${_ANDROID_API_REGEX} _ANDROID_API_LINE "${_ANDROID_API_LEVEL_H_CONTENT}") + string(REGEX REPLACE ${_ANDROID_API_REGEX} "\\1" _ANDROID_API "${_ANDROID_API_LINE}") + if(_ANDROID_API) + set(CMAKE_SYSTEM_VERSION "${_ANDROID_API}") + endif() + + unset(_ANDROID_API_LEVEL_H) + unset(_ANDROID_API_LEVEL_H_CONTENT) + unset(_ANDROID_API_REGEX) + unset(_ANDROID_API_LINE) + unset(_ANDROID_API) + endif() else() execute_process(COMMAND ${CMAKE_UNAME} -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake index 777c680..1c6f0df 100644 --- a/Modules/CMakeSwiftInformation.cmake +++ b/Modules/CMakeSwiftInformation.cmake @@ -21,7 +21,8 @@ set(CMAKE_INCLUDE_FLAG_Swift "-I ") # FIXME: Move compiler- and platform-specific flags to the above-included modules. if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR CMAKE_SYSTEM_NAME STREQUAL "iOS" - OR CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "watchOS") + OR CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "visionOS" + OR CMAKE_SYSTEM_NAME STREQUAL "watchOS") set(CMAKE_SHARED_LIBRARY_SONAME_Swift_FLAG "-Xlinker -install_name -Xlinker ") elseif(NOT CMAKE_SYSTEM_NAME STREQUAL Windows) set(CMAKE_SHARED_LIBRARY_SONAME_Swift_FLAG "-Xlinker -soname -Xlinker ") @@ -30,7 +31,8 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL Windows) set(CMAKE_EXECUTABLE_RUNTIME_Swift_FLAG "-Xlinker -rpath -Xlinker ") set(CMAKE_SHARED_LIBRARY_RUNTIME_Swift_FLAG "-Xlinker -rpath -Xlinker ") if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR CMAKE_SYSTEM_NAME STREQUAL "iOS" - OR CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "watchOS") + OR CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "visionOS" + OR CMAKE_SYSTEM_NAME STREQUAL "watchOS") set(CMAKE_EXECUTABLE_RUNTIME_Swift_FLAG_SEP "") set(CMAKE_SHARED_LIBRARY_RUNTIME_Swift_FLAG_SEP "") else() diff --git a/Modules/CMakeSystemSpecificInitialize.cmake b/Modules/CMakeSystemSpecificInitialize.cmake index e87d868..ee8cb86 100644 --- a/Modules/CMakeSystemSpecificInitialize.cmake +++ b/Modules/CMakeSystemSpecificInitialize.cmake @@ -25,7 +25,7 @@ unset(LINUX) # It is useful to share the same aforementioned configuration files and # avoids duplicating them in case of tightly related platforms. # -# An example are the platforms supported by Xcode (macOS, iOS, tvOS, +# An example are the platforms supported by Xcode (macOS, iOS, tvOS, visionOS # and watchOS). For all of those the CMAKE_EFFECTIVE_SYSTEM_NAME is # set to Apple which results in using # Platform/Apple-AppleClang-CXX.cmake for the Apple C++ compiler. diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake index c2627e7..e9b7ae4 100644 --- a/Modules/FindCUDAToolkit.cmake +++ b/Modules/FindCUDAToolkit.cmake @@ -965,12 +965,15 @@ if(CUDAToolkit_FOUND) # search paths without symlinks if(CUDAToolkit_LIBRARY_DIR MATCHES ".*/cuda/${CUDAToolkit_VERSION_MAJOR}.${CUDAToolkit_VERSION_MINOR}/lib64$") # Search location for math_libs/ - file(REAL_PATH "${CUDAToolkit_LIBRARY_DIR}/../../../" _cmake_search_dir) - list(APPEND CUDAToolkit_LIBRARY_SEARCH_DIRS "${_cmake_search_dir}") - - # Search location for extras like cupti - file(REAL_PATH "${CUDAToolkit_LIBRARY_DIR}/../" _cmake_search_dir) - list(APPEND CUDAToolkit_LIBRARY_SEARCH_DIRS "${_cmake_search_dir}") + block(SCOPE_FOR POLICIES) + cmake_policy(SET CMP0152 NEW) + file(REAL_PATH "${CUDAToolkit_LIBRARY_DIR}/../../../../../" _cmake_search_dir) + list(APPEND CUDAToolkit_LIBRARY_SEARCH_DIRS "${_cmake_search_dir}") + + # Search location for extras like cupti + file(REAL_PATH "${CUDAToolkit_LIBRARY_DIR}/../../../" _cmake_search_dir) + list(APPEND CUDAToolkit_LIBRARY_SEARCH_DIRS "${_cmake_search_dir}") + endblock() endif() # If no `CUDAToolkit_LIBRARY_ROOT` exists set it based on CUDAToolkit_LIBRARY_DIR diff --git a/Modules/FindCURL.cmake b/Modules/FindCURL.cmake index acb87dc..2f33dac 100644 --- a/Modules/FindCURL.cmake +++ b/Modules/FindCURL.cmake @@ -58,6 +58,18 @@ returns its results with no further action. Set ``CURL_NO_CURL_CMAKE`` to ``ON`` to disable this search. +Hints +^^^^^ + +``CURL_USE_STATIC_LIBS`` + + .. versionadded:: 3.28 + + Set to ``TRUE`` to use static libraries. + + This is meaningful only when CURL is not found via its + CMake Package Configuration file. + #]=======================================================================] include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) @@ -193,6 +205,11 @@ if(CURL_FOUND) set_target_properties(CURL::libcurl PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIRS}") + if(CURL_USE_STATIC_LIBS) + set_property(TARGET CURL::libcurl APPEND PROPERTY + INTERFACE_COMPILE_DEFINITIONS "CURL_STATICLIB") + endif() + if(EXISTS "${CURL_LIBRARY}") set_target_properties(CURL::libcurl PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "C" @@ -212,5 +229,11 @@ if(CURL_FOUND) IMPORTED_LINK_INTERFACE_LANGUAGES "C" IMPORTED_LOCATION_DEBUG "${CURL_LIBRARY_DEBUG}") endif() + + if(CURL_USE_STATIC_LIBS AND MSVC) + set_target_properties(CURL::libcurl PROPERTIES + INTERFACE_LINK_LIBRARIES "normaliz.lib;ws2_32.lib;wldap32.lib") + endif() + endif() endif() diff --git a/Modules/FindEXPAT.cmake b/Modules/FindEXPAT.cmake index 3bedc73..762931e 100644 --- a/Modules/FindEXPAT.cmake +++ b/Modules/FindEXPAT.cmake @@ -30,6 +30,15 @@ This module will set the following variables in your project: ``EXPAT_FOUND`` true if the Expat headers and libraries were found. +Hints +^^^^^ + +``EXPAT_USE_STATIC_LIBS`` + + .. versionadded:: 3.28 + + Set to ``TRUE`` to use static libraries. + #]=======================================================================] find_package(PkgConfig QUIET) @@ -43,8 +52,13 @@ set(EXPAT_NAMES expat expatw) set(EXPAT_NAMES_DEBUG expatd expatwd) if(WIN32) - list(APPEND EXPAT_NAMES expatMT expatMD expatwMT expatwMD) - list(APPEND EXPAT_NAMES_DEBUG expatdMT expatdMD expatwdMT expatwdMD) + if(EXPAT_USE_STATIC_LIBS) + list(APPEND EXPAT_NAMES expatMT expatwMT) + list(APPEND EXPAT_NAMES_DEBUG expatdMT expatwdMT) + else() + list(APPEND EXPAT_NAMES expatMT expatMD expatwMT expatwMD) + list(APPEND EXPAT_NAMES_DEBUG expatdMT expatdMD expatwdMT expatwdMD) + endif() endif() # Allow EXPAT_LIBRARY to be set manually, as the location of the expat library @@ -115,6 +129,11 @@ if(EXPAT_FOUND) IMPORTED_LINK_INTERFACE_LANGUAGES "C" INTERFACE_INCLUDE_DIRECTORIES "${EXPAT_INCLUDE_DIRS}") + if(EXPAT_USE_STATIC_LIBS) + set_property(TARGET EXPAT::EXPAT APPEND PROPERTY + INTERFACE_COMPILE_DEFINITIONS "XML_STATIC") + endif() + if(EXPAT_LIBRARY_RELEASE) set_property(TARGET EXPAT::EXPAT APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) diff --git a/Modules/FindFLTK.cmake b/Modules/FindFLTK.cmake index d54d2f6..a245c6c 100644 --- a/Modules/FindFLTK.cmake +++ b/Modules/FindFLTK.cmake @@ -232,7 +232,7 @@ else() find_program(FLTK_CONFIG_SCRIPT fltk-config PATHS ${FLTK_BIN_DIR}) if(FLTK_CONFIG_SCRIPT) if(NOT FLTK_INCLUDE_DIR) - exec_program(${FLTK_CONFIG_SCRIPT} ARGS --cxxflags OUTPUT_VARIABLE FLTK_CXXFLAGS) + execute_process(COMMAND ${FLTK_CONFIG_SCRIPT} --cxxflags OUTPUT_VARIABLE FLTK_CXXFLAGS) if(FLTK_CXXFLAGS) string(REGEX MATCHALL "-I[^ ]*" _fltk_temp_dirs ${FLTK_CXXFLAGS}) string(REPLACE "-I" "" _fltk_temp_dirs "${_fltk_temp_dirs}") @@ -256,7 +256,7 @@ else() # Try to find FLTK library if(UNIX) if(FLTK_CONFIG_SCRIPT) - exec_program(${FLTK_CONFIG_SCRIPT} ARGS --libs OUTPUT_VARIABLE _FLTK_POSSIBLE_LIBS) + execute_process(COMMAND ${FLTK_CONFIG_SCRIPT} --libs OUTPUT_VARIABLE _FLTK_POSSIBLE_LIBS) if(_FLTK_POSSIBLE_LIBS) get_filename_component(_FLTK_POSSIBLE_LIBRARY_DIR ${_FLTK_POSSIBLE_LIBS} PATH) endif() @@ -292,12 +292,12 @@ else() # Find the extra libraries needed for the fltk_images library. if(UNIX) if(FLTK_CONFIG_SCRIPT) - exec_program(${FLTK_CONFIG_SCRIPT} ARGS --use-images --ldflags + execute_process(COMMAND ${FLTK_CONFIG_SCRIPT} --use-images --ldflags OUTPUT_VARIABLE FLTK_IMAGES_LDFLAGS) set(FLTK_LIBS_EXTRACT_REGEX ".*-lfltk_images (.*) -lfltk.*") if("${FLTK_IMAGES_LDFLAGS}" MATCHES "${FLTK_LIBS_EXTRACT_REGEX}") string(REGEX REPLACE " +" ";" FLTK_IMAGES_LIBS "${CMAKE_MATCH_1}") - # The EXEC_PROGRAM will not be inherited into subdirectories from + # The execute_process() will not be inherited into subdirectories from # the file that originally included this module. Save the answer. set(FLTK_IMAGES_LIBS "${FLTK_IMAGES_LIBS}" CACHE INTERNAL "Extra libraries for fltk_images library.") diff --git a/Modules/FindFLTK2.cmake b/Modules/FindFLTK2.cmake index a43f7a4..2f6e41d 100644 --- a/Modules/FindFLTK2.cmake +++ b/Modules/FindFLTK2.cmake @@ -191,12 +191,12 @@ if(FLTK2_DIR) if(UNIX) find_program(FLTK2_CONFIG_SCRIPT fltk2-config PATHS ${FLTK2_BIN_DIR}) if(FLTK2_CONFIG_SCRIPT) - exec_program(${FLTK2_CONFIG_SCRIPT} ARGS --use-images --ldflags + execute_process(COMMAND ${FLTK2_CONFIG_SCRIPT} --use-images --ldflags OUTPUT_VARIABLE FLTK2_IMAGES_LDFLAGS) set(FLTK2_LIBS_EXTRACT_REGEX ".*-lfltk2_images (.*) -lfltk2.*") if("${FLTK2_IMAGES_LDFLAGS}" MATCHES "${FLTK2_LIBS_EXTRACT_REGEX}") string(REGEX REPLACE " +" ";" FLTK2_IMAGES_LIBS "${CMAKE_MATCH_1}") - # The EXEC_PROGRAM will not be inherited into subdirectories from + # The execute_process() will not be inherited into subdirectories from # the file that originally included this module. Save the answer. set(FLTK2_IMAGES_LIBS "${FLTK2_IMAGES_LIBS}" CACHE INTERNAL "Extra libraries for fltk_images library.") diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake index a92fb52..008b537 100644 --- a/Modules/FindProtobuf.cmake +++ b/Modules/FindProtobuf.cmake @@ -136,15 +136,95 @@ Example: Variable to define with autogenerated Python files ``ARGN`` ``.proto`` files + +.. command:: protobuf_generate + + .. versionadded:: 3.13 + + Automatically generate source files from ``.proto`` schema files at build time:: + + protobuf_generate ( + TARGET <target> + [LANGUAGE <lang>] + [OUT_VAR <out_var>] + [EXPORT_MACRO <macro>] + [PROTOC_OUT_DIR <dir>] + [PLUGIN <plugin>] + [PLUGIN_OPTIONS <plugin_options>] + [DEPENDENCIES <depends] + [PROTOS <protobuf_files>] + [IMPORT_DIRS <dirs>] + [GENERATE_EXTENSIONS <extensions>] + [PROTOC_OPTIONS <protoc_options>] + [APPEND_PATH]) + + ``APPEND_PATH`` + A flag that causes the base path of all proto schema files to be added to + ``IMPORT_DIRS``. + ``LANGUAGE`` + A single value: cpp or python. Determines what kind of source files are + being generated. Defaults to cpp. + ``OUT_VAR`` + Name of a CMake variable that will be filled with the paths to the generated + source files. + ``EXPORT_MACRO`` + Name of a macro that is applied to all generated Protobuf message classes + and extern variables. It can, for example, be used to declare DLL exports. + ``PROTOC_OUT_DIR`` + Output directory of generated source files. Defaults to ``CMAKE_CURRENT_BINARY_DIR``. + ``PLUGIN`` + .. versionadded:: 3.21 + + An optional plugin executable. This could, for example, be the path to + ``grpc_cpp_plugin``. + ``PLUGIN_OPTIONS`` + .. versionadded:: 3.28 + + Additional options provided to the plugin, such as ``generate_mock_code=true`` + for the gRPC cpp plugin. + ``DEPENDENCIES`` + .. versionadded:: 3.28 + + Arguments forwarded to the ``DEPENDS`` of the underlying ``add_custom_command`` + invocation. + ``TARGET`` + CMake target that will have the generated files added as sources. + ``PROTOS`` + List of proto schema files. If omitted, then every source file ending in *proto* of ``TARGET`` will be used. + ``IMPORT_DIRS`` + A common parent directory for the schema files. For example, if the schema file is + ``proto/helloworld/helloworld.proto`` and the import directory ``proto/`` then the + generated files are ``${PROTOC_OUT_DIR}/helloworld/helloworld.pb.h`` and + ``${PROTOC_OUT_DIR}/helloworld/helloworld.pb.cc``. + ``GENERATE_EXTENSIONS`` + If LANGUAGE is omitted then this must be set to the extensions that protoc generates. + ``PROTOC_OPTIONS`` + .. versionadded:: 3.28 + + Additional arguments that are forwarded to protoc. + + Example:: + + find_package(gRPC CONFIG REQUIRED) + find_package(Protobuf REQUIRED) + add_library(ProtoTest Test.proto) + target_link_libraries(ProtoTest PUBLIC gRPC::grpc++) + protobuf_generate(TARGET ProtoTest) + protobuf_generate( + TARGET ProtoTest + LANGUAGE grpc + PLUGIN protoc-gen-grpc=$<TARGET_FILE:gRPC::grpc_cpp_plugin> + PLUGIN_OPTIONS generate_mock_code=true + GENERATE_EXTENSIONS .grpc.pb.h .grpc.pb.cc) #]=======================================================================] function(protobuf_generate) set(_options APPEND_PATH DESCRIPTORS) - set(_singleargs LANGUAGE OUT_VAR EXPORT_MACRO PROTOC_OUT_DIR PLUGIN) + set(_singleargs LANGUAGE OUT_VAR EXPORT_MACRO PROTOC_OUT_DIR PLUGIN PLUGIN_OPTIONS DEPENDENCIES) if(COMMAND target_sources) list(APPEND _singleargs TARGET) endif() - set(_multiargs PROTOS IMPORT_DIRS GENERATE_EXTENSIONS) + set(_multiargs PROTOS IMPORT_DIRS GENERATE_EXTENSIONS PROTOC_OPTIONS) cmake_parse_arguments(protobuf_generate "${_options}" "${_singleargs}" "${_multiargs}" "${ARGN}") @@ -168,9 +248,18 @@ function(protobuf_generate) endif() if(protobuf_generate_EXPORT_MACRO AND protobuf_generate_LANGUAGE STREQUAL cpp) - set(_dll_export_decl "dllexport_decl=${protobuf_generate_EXPORT_MACRO}:") + set(_dll_export_decl "dllexport_decl=${protobuf_generate_EXPORT_MACRO}") endif() + foreach(_option ${_dll_export_decl} ${protobuf_generate_PLUGIN_OPTIONS}) + # append comma - not using CMake lists and string replacement as users + # might have semicolons in options + if(_plugin_options) + set( _plugin_options "${_plugin_options},") + endif() + set(_plugin_options "${_plugin_options}${_option}") + endforeach() + if(protobuf_generate_PLUGIN) set(_plugin "--plugin=${protobuf_generate_PLUGIN}") endif() @@ -204,14 +293,12 @@ function(protobuf_generate) # Create an include path for each file specified foreach(_file ${protobuf_generate_PROTOS}) get_filename_component(_abs_file ${_file} ABSOLUTE) - get_filename_component(_abs_path ${_abs_file} PATH) - list(FIND _protobuf_include_path ${_abs_path} _contains_already) + get_filename_component(_abs_dir ${_abs_file} DIRECTORY) + list(FIND _protobuf_include_path ${_abs_dir} _contains_already) if(${_contains_already} EQUAL -1) - list(APPEND _protobuf_include_path -I ${_abs_path}) + list(APPEND _protobuf_include_path -I ${_abs_dir}) endif() endforeach() - else() - set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR}) endif() foreach(DIR ${protobuf_generate_IMPORT_DIRS}) @@ -222,6 +309,10 @@ function(protobuf_generate) endif() endforeach() + if(NOT _protobuf_include_path) + set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR}) + endif() + set(_generated_srcs_all) foreach(_proto ${protobuf_generate_PROTOS}) get_filename_component(_abs_file ${_proto} ABSOLUTE) @@ -246,12 +337,20 @@ function(protobuf_generate) endif() list(APPEND _generated_srcs_all ${_generated_srcs}) + set(_comment "Running ${protobuf_generate_LANGUAGE} protocol buffer compiler on ${_proto}") + if(protobuf_generate_PROTOC_OPTIONS) + set(_comment "${_comment}, protoc-options: ${protobuf_generate_PROTOC_OPTIONS}") + endif() + if(_plugin_options) + set(_comment "${_comment}, plugin-options: ${_plugin_options}") + endif() + add_custom_command( OUTPUT ${_generated_srcs} - COMMAND protobuf::protoc - ARGS --${protobuf_generate_LANGUAGE}_out ${_dll_export_decl}${protobuf_generate_PROTOC_OUT_DIR} ${_plugin} ${_dll_desc_out} ${_protobuf_include_path} ${_abs_file} - DEPENDS ${_abs_file} protobuf::protoc - COMMENT "Running ${protobuf_generate_LANGUAGE} protocol buffer compiler on ${_proto}" + COMMAND protobuf::protoc + ARGS ${protobuf_generate_PROTOC_OPTIONS} --${protobuf_generate_LANGUAGE}_out ${_plugin_options}:${protobuf_generate_PROTOC_OUT_DIR} ${_plugin} ${_dll_desc_out} ${_protobuf_include_path} ${_abs_file} + DEPENDS ${_abs_file} protobuf::protoc ${protobuf_generate_DEPENDENCIES} + COMMENT ${_comment} VERBATIM ) endforeach() diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake index 76d4a9b..0f0e2af 100644 --- a/Modules/FindPython/Support.cmake +++ b/Modules/FindPython/Support.cmake @@ -981,7 +981,7 @@ function (_PYTHON_VALIDATE_COMPILER) # retrieve python environment version from compiler set (working_dir "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/PythonCompilerVersion.dir") - file (WRITE "${working_dir}/version.py" "import sys; sys.stdout.write('.'.join([str(x) for x in sys.version_info[:3]]))\n") + file (WRITE "${working_dir}/version.py" "import sys; sys.stdout.write('.'.join([str(x) for x in sys.version_info[:3]])); sys.stdout.flush()\n") execute_process (COMMAND ${launcher} "${_${_PYTHON_PREFIX}_COMPILER}" ${_${_PYTHON_PREFIX}_IRON_PYTHON_COMPILER_ARCH_FLAGS} /target:exe /embed "${working_dir}/version.py" @@ -2520,7 +2520,7 @@ if ("Compiler" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS) # retrieve python environment version from compiler _python_get_launcher (_${_PYTHON_PREFIX}_COMPILER_LAUNCHER COMPILER) set (_${_PYTHON_PREFIX}_VERSION_DIR "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/PythonCompilerVersion.dir") - file (WRITE "${_${_PYTHON_PREFIX}_VERSION_DIR}/version.py" "import sys; sys.stdout.write('.'.join([str(x) for x in sys.version_info[:3]]))\n") + file (WRITE "${_${_PYTHON_PREFIX}_VERSION_DIR}/version.py" "import sys; sys.stdout.write('.'.join([str(x) for x in sys.version_info[:3]])); sys.stdout.flush()\n") execute_process (COMMAND ${_${_PYTHON_PREFIX}_COMPILER_LAUNCHER} "${_${_PYTHON_PREFIX}_COMPILER}" ${_${_PYTHON_PREFIX}_IRON_PYTHON_COMPILER_ARCH_FLAGS} /target:exe /embed "${_${_PYTHON_PREFIX}_VERSION_DIR}/version.py" diff --git a/Modules/FindQt.cmake b/Modules/FindQt.cmake index 44a1f41..604f8e3 100644 --- a/Modules/FindQt.cmake +++ b/Modules/FindQt.cmake @@ -91,7 +91,7 @@ endif () # now find qmake find_program(QT_QMAKE_EXECUTABLE_FINDQT NAMES qmake PATHS "${QT_SEARCH_PATH}/bin" "$ENV{QTDIR}/bin") if(QT_QMAKE_EXECUTABLE_FINDQT) - exec_program(${QT_QMAKE_EXECUTABLE_FINDQT} ARGS "-query QT_VERSION" + execute_process(COMMAND ${QT_QMAKE_EXECUTABLE_FINDQT} -query QT_VERSION OUTPUT_VARIABLE QTVERSION) if(QTVERSION MATCHES "4") set(QT_QMAKE_EXECUTABLE ${QT_QMAKE_EXECUTABLE_FINDQT} CACHE PATH "Qt4 qmake program.") @@ -103,8 +103,8 @@ if(QT_QMAKE_EXECUTABLE_FINDQT) endif() if(QT_QMAKE_EXECUTABLE_FINDQT) - exec_program( ${QT_QMAKE_EXECUTABLE_FINDQT} - ARGS "-query QT_INSTALL_HEADERS" + execute_process(COMMAND ${QT_QMAKE_EXECUTABLE_FINDQT} + -query QT_INSTALL_HEADERS OUTPUT_VARIABLE qt_headers ) endif() diff --git a/Modules/FindwxWindows.cmake b/Modules/FindwxWindows.cmake index 6e4be91..d1b25e1 100644 --- a/Modules/FindwxWindows.cmake +++ b/Modules/FindwxWindows.cmake @@ -635,14 +635,14 @@ else() # remember: always link shared to use systems GL etc. libs (no static # linking, just link *against* static .a libs) if(WXWINDOWS_USE_SHARED_LIBS) - set(WX_CONFIG_ARGS_LIBS "--libs") + set(WX_CONFIG_ARGS_LIBS --libs) else() - set(WX_CONFIG_ARGS_LIBS "--static --libs") + set(WX_CONFIG_ARGS_LIBS --static --libs) endif() # do we need additionial wx GL stuff like GLCanvas ? if(WXWINDOWS_USE_GL) - string(APPEND WX_CONFIG_ARGS_LIBS " --gl-libs" ) + list(APPEND WX_CONFIG_ARGS_LIBS --gl-libs) endif() ##message("DBG: WX_CONFIG_ARGS_LIBS=${WX_CONFIG_ARGS_LIBS}===") @@ -662,14 +662,15 @@ else() ##CMAKE_WXWINDOWS_CXX_FLAGS=${CMAKE_WXWINDOWS_CXX_FLAGS}===") # keep the back-quoted string for clarity - set(WXWINDOWS_LIBRARIES "`${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE} ${WX_CONFIG_ARGS_LIBS}`") + string(REPLACE ";" " " _wx_config_args_libs "${WX_CONFIG_ARGS_LIBS}") + set(WXWINDOWS_LIBRARIES "`${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE} ${_wx_config_args_libs}`") ##message("DBG2: for linking: ##WXWINDOWS_LIBRARIES=${WXWINDOWS_LIBRARIES}===") # evaluate wx-config output to separate linker flags and linkdirs for # rpath: - exec_program(${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE} - ARGS ${WX_CONFIG_ARGS_LIBS} + execute_process(COMMAND ${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE} + ${WX_CONFIG_ARGS_LIBS} OUTPUT_VARIABLE WX_CONFIG_LIBS ) ## extract linkdirs (-L) for rpath diff --git a/Modules/Platform/Apple-Clang.cmake b/Modules/Platform/Apple-Clang.cmake index 0681bfb..4d7546a 100644 --- a/Modules/Platform/Apple-Clang.cmake +++ b/Modules/Platform/Apple-Clang.cmake @@ -22,6 +22,10 @@ macro(__apple_compiler_clang lang) set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "-mtvos-version-min=") elseif(_CMAKE_OSX_SYSROOT_PATH MATCHES "/AppleTVSimulator") set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "-mtvos-simulator-version-min=") + elseif(_CMAKE_OSX_SYSROOT_PATH MATCHES "/XROS") + set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "-mtargetos=xros") + elseif(_CMAKE_OSX_SYSROOT_PATH MATCHES "/XRSimulator") + set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "-mtargetos=xros") elseif(_CMAKE_OSX_SYSROOT_PATH MATCHES "/WatchOS") set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "-mwatchos-version-min=") elseif(_CMAKE_OSX_SYSROOT_PATH MATCHES "/WatchSimulator") diff --git a/Modules/Platform/Darwin-Initialize.cmake b/Modules/Platform/Darwin-Initialize.cmake index e253392..8d5bf8c 100644 --- a/Modules/Platform/Darwin-Initialize.cmake +++ b/Modules/Platform/Darwin-Initialize.cmake @@ -43,7 +43,7 @@ if(NOT CMAKE_CROSSCOMPILING AND unset(_sysctl_stdout) endif() -# macOS, iOS, tvOS, and watchOS should lookup compilers from +# macOS, iOS, tvOS, visionOS, and watchOS should lookup compilers from # Platform/Apple-${CMAKE_CXX_COMPILER_ID}-<LANG> set(CMAKE_EFFECTIVE_SYSTEM_NAME "Apple") @@ -76,6 +76,8 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL iOS) set(_CMAKE_OSX_SYSROOT_DEFAULT "iphoneos") elseif(CMAKE_SYSTEM_NAME STREQUAL tvOS) set(_CMAKE_OSX_SYSROOT_DEFAULT "appletvos") +elseif(CMAKE_SYSTEM_NAME STREQUAL visionOS) + set(_CMAKE_OSX_SYSROOT_DEFAULT "xros") elseif(CMAKE_SYSTEM_NAME STREQUAL watchOS) set(_CMAKE_OSX_SYSROOT_DEFAULT "watchos") elseif("${CMAKE_GENERATOR}" MATCHES Xcode diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index 48a9065..d614182 100644 --- a/Modules/Platform/Darwin.cmake +++ b/Modules/Platform/Darwin.cmake @@ -1,4 +1,4 @@ -if(CMAKE_SYSTEM_NAME STREQUAL "iOS" OR CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "watchOS") +if(CMAKE_SYSTEM_NAME STREQUAL "iOS" OR CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "visionOS" OR CMAKE_SYSTEM_NAME STREQUAL "watchOS") if(NOT DEFINED CMAKE_MACOSX_BUNDLE) set(CMAKE_MACOSX_BUNDLE ON) endif() diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake index 8e96bf4..829ab9b 100644 --- a/Modules/Platform/Windows-MSVC.cmake +++ b/Modules/Platform/Windows-MSVC.cmake @@ -28,6 +28,8 @@ endif() if(CMAKE_SYSTEM_NAME STREQUAL "WindowsCE") set(_PLATFORM_LINK_FLAGS " /subsystem:windowsce") +elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsKernelModeDriver") + set(_PLATFORM_LINK_FLAGS " -subsystem:native -kernel -MANIFEST:NO") else() set(_PLATFORM_LINK_FLAGS "") endif() @@ -223,6 +225,18 @@ elseif(WINDOWS_PHONE OR WINDOWS_STORE) else() set(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib") endif() +elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsKernelModeDriver") + set(CMAKE_C_STANDARD_LIBRARIES_INIT "") + set(_FLAGS_C " -kernel") + set(_FLAGS_CXX " -kernel") + foreach(t EXE SHARED MODULE) + string(APPEND CMAKE_${t}_LINKER_FLAGS_INIT " -NODEFAULTLIB") + endforeach() + if((_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "x64") OR (_MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "x64")) + set(_PLATFORM_DEFINES "${_PLATFORM_DEFINES} -D_AMD64_ -DAMD64") + elseif((_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM64") OR (_MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM64")) + set(_PLATFORM_DEFINES "${_PLATFORM_DEFINES} -D_ARM64_ -DARM64") + endif() else() set(_PLATFORM_DEFINES "/DWIN32") if((_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM64EC") OR (_MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM64EC")) @@ -294,7 +308,7 @@ endif() # add /debug and /INCREMENTAL:YES to DEBUG and RELWITHDEBINFO also add pdbtype # on versions that support it set( MSVC_INCREMENTAL_YES_FLAG "") -if(NOT WINDOWS_PHONE AND NOT WINDOWS_STORE) +if(NOT WINDOWS_PHONE AND NOT WINDOWS_STORE AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsKernelModeDriver") if(NOT MSVC_INCREMENTAL_DEFAULT) set( MSVC_INCREMENTAL_YES_FLAG "/INCREMENTAL:YES") else() @@ -353,8 +367,14 @@ macro(__windows_compiler_msvc lang) set(_CMAKE_VS_LINK_DLL "<CMAKE_COMMAND> -E vs_link_dll --intdir=<OBJECT_DIR> --rc=<CMAKE_RC_COMPILER> --mt=<CMAKE_MT> --manifests <MANIFESTS> -- ") set(_CMAKE_VS_LINK_EXE "<CMAKE_COMMAND> -E vs_link_exe --intdir=<OBJECT_DIR> --rc=<CMAKE_RC_COMPILER> --mt=<CMAKE_MT> --manifests <MANIFESTS> -- ") endif() + if(CMAKE_SYSTEM_NAME STREQUAL "WindowsKernelModeDriver") + set(_DLL_DRIVER "-driver") + else() + set(_DLL_DRIVER "/dll") + endif() set(CMAKE_${lang}_CREATE_SHARED_LIBRARY - "${_CMAKE_VS_LINK_DLL}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /dll /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} <LINK_FLAGS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}") + "${_CMAKE_VS_LINK_DLL}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> ${_DLL_DRIVER} /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} <LINK_FLAGS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}") + unset(_DLL_DRIVER) set(CMAKE_${lang}_CREATE_SHARED_MODULE ${CMAKE_${lang}_CREATE_SHARED_LIBRARY}) set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "<CMAKE_AR> ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ") diff --git a/Modules/Platform/Windows.cmake b/Modules/Platform/Windows.cmake index 8697e7a..1bf39cf 100644 --- a/Modules/Platform/Windows.cmake +++ b/Modules/Platform/Windows.cmake @@ -1,7 +1,11 @@ set(CMAKE_STATIC_LIBRARY_PREFIX "") set(CMAKE_STATIC_LIBRARY_SUFFIX ".lib") set(CMAKE_SHARED_LIBRARY_PREFIX "") # lib -set(CMAKE_SHARED_LIBRARY_SUFFIX ".dll") # .so +if(CMAKE_SYSTEM_NAME STREQUAL "WindowsKernelModeDriver") + set(CMAKE_SHARED_LIBRARY_SUFFIX ".sys") # .so +else() + set(CMAKE_SHARED_LIBRARY_SUFFIX ".dll") # .so +endif() set(CMAKE_IMPORT_LIBRARY_PREFIX "") set(CMAKE_IMPORT_LIBRARY_SUFFIX ".lib") set(CMAKE_EXECUTABLE_SUFFIX ".exe") # .exe diff --git a/Modules/Platform/WindowsKernelModeDriver-Initialize.cmake b/Modules/Platform/WindowsKernelModeDriver-Initialize.cmake new file mode 100644 index 0000000..6f0ef33 --- /dev/null +++ b/Modules/Platform/WindowsKernelModeDriver-Initialize.cmake @@ -0,0 +1,11 @@ +# undocumented, do not use outside of CMake +cmake_language(GET_EXPERIMENTAL_FEATURE_ENABLED "WindowsKernelModeDriver" _cmake_windows_kernel_mode_driver_enabled) +if(NOT _cmake_windows_kernel_mode_driver_enabled) + message(FATAL_ERROR "Windows kernel-mode driver experimental support is not enabled.") +endif() + +if(CMAKE_GENERATOR MATCHES "Visual Studio") + message(FATAL_ERROR "Visual Studio generators do not yet support CMAKE_SYSTEM_NAME=WindowsKernelModeDriver.") +endif() + +set(_CMAKE_FEATURE_DETECTION_TARGET_TYPE STATIC_LIBRARY) diff --git a/Modules/Platform/WindowsKernelModeDriver-MSVC-C.cmake b/Modules/Platform/WindowsKernelModeDriver-MSVC-C.cmake new file mode 100644 index 0000000..ce8060b --- /dev/null +++ b/Modules/Platform/WindowsKernelModeDriver-MSVC-C.cmake @@ -0,0 +1 @@ +include(Platform/Windows-MSVC-C) diff --git a/Modules/Platform/WindowsKernelModeDriver-MSVC-CXX.cmake b/Modules/Platform/WindowsKernelModeDriver-MSVC-CXX.cmake new file mode 100644 index 0000000..281eadc --- /dev/null +++ b/Modules/Platform/WindowsKernelModeDriver-MSVC-CXX.cmake @@ -0,0 +1 @@ +include(Platform/Windows-MSVC-CXX) diff --git a/Modules/Platform/WindowsKernelModeDriver.cmake b/Modules/Platform/WindowsKernelModeDriver.cmake new file mode 100644 index 0000000..65b2eae --- /dev/null +++ b/Modules/Platform/WindowsKernelModeDriver.cmake @@ -0,0 +1 @@ +include(Platform/Windows) diff --git a/Modules/Platform/visionOS-Determine-CXX.cmake b/Modules/Platform/visionOS-Determine-CXX.cmake new file mode 100644 index 0000000..ac80fa6 --- /dev/null +++ b/Modules/Platform/visionOS-Determine-CXX.cmake @@ -0,0 +1 @@ +include(Platform/Darwin-Determine-CXX) diff --git a/Modules/Platform/visionOS-Initialize.cmake b/Modules/Platform/visionOS-Initialize.cmake new file mode 100644 index 0000000..e8431bc --- /dev/null +++ b/Modules/Platform/visionOS-Initialize.cmake @@ -0,0 +1,7 @@ +include(Platform/Darwin-Initialize) + +if(NOT _CMAKE_OSX_SYSROOT_PATH MATCHES "/XR(OS|Simulator)") + message(FATAL_ERROR "${CMAKE_OSX_SYSROOT} is not an visionOS SDK") +endif() + +set(_CMAKE_FEATURE_DETECTION_TARGET_TYPE STATIC_LIBRARY) diff --git a/Modules/Platform/visionOS.cmake b/Modules/Platform/visionOS.cmake new file mode 100644 index 0000000..850ddc2 --- /dev/null +++ b/Modules/Platform/visionOS.cmake @@ -0,0 +1 @@ +include(Platform/Darwin) diff --git a/Modules/UsePkgConfig.cmake b/Modules/UsePkgConfig.cmake index 32d228d..b020259 100644 --- a/Modules/UsePkgConfig.cmake +++ b/Modules/UsePkgConfig.cmake @@ -35,25 +35,25 @@ macro(PKGCONFIG _package _include_DIR _link_DIR _link_FLAGS _cflags) # if pkg-config has been found if(PKGCONFIG_EXECUTABLE) - exec_program(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --exists RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull ) + execute_process(COMMAND ${PKGCONFIG_EXECUTABLE} ${_package} --exists RESULT_VARIABLE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull ) # and if the package of interest also exists for pkg-config, then get the information if(NOT _return_VALUE) - exec_program(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --variable=includedir + execute_process(COMMAND ${PKGCONFIG_EXECUTABLE} ${_package} --variable=includedir OUTPUT_VARIABLE ${_include_DIR} ) string(REGEX REPLACE "[\r\n]" " " ${_include_DIR} "${${_include_DIR}}") - exec_program(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --variable=libdir + execute_process(COMMAND ${PKGCONFIG_EXECUTABLE} ${_package} --variable=libdir OUTPUT_VARIABLE ${_link_DIR} ) string(REGEX REPLACE "[\r\n]" " " ${_link_DIR} "${${_link_DIR}}") - exec_program(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --libs + execute_process(COMMAND ${PKGCONFIG_EXECUTABLE} ${_package} --libs OUTPUT_VARIABLE ${_link_FLAGS} ) string(REGEX REPLACE "[\r\n]" " " ${_link_FLAGS} "${${_link_FLAGS}}") - exec_program(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --cflags + execute_process(COMMAND ${PKGCONFIG_EXECUTABLE} ${_package} --cflags OUTPUT_VARIABLE ${_cflags} ) string(REGEX REPLACE "[\r\n]" " " ${_cflags} "${${_cflags}}") diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake index ca16bc2..cece973 100644 --- a/Modules/UseSWIG.cmake +++ b/Modules/UseSWIG.cmake @@ -189,7 +189,7 @@ ensure generated files will receive the required settings. :ref:`Makefile <Makefile Generators>`, :ref:`Ninja <Ninja Generators>`, :generator:`Xcode`, and :ref:`Visual Studio <Visual Studio Generators>` - (:generator:`Visual Studio 11 2012` and above) generators. Default value is + (:generator:`Visual Studio 12 2013` and above) generators. Default value is ``FALSE``. .. versionadded:: 3.21 @@ -353,7 +353,7 @@ as well as ``SWIG``: :ref:`Makefile <Makefile Generators>`, :ref:`Ninja <Ninja Generators>`, :generator:`Xcode`, and :ref:`Visual Studio <Visual Studio Generators>` - (:generator:`Visual Studio 11 2012` and above) generators. Default value is + (:generator:`Visual Studio 12 2013` and above) generators. Default value is ``FALSE``. Source file property ``USE_SWIG_DEPENDENCIES``, if not defined, will be diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index b01e1e7..708aec7 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -438,6 +438,7 @@ add_library( cmUVHandlePtr.h cmUVProcessChain.cxx cmUVProcessChain.h + cmUVStream.h cmUVStreambuf.h cmUVSignalHackRAII.h cmVariableWatch.cxx @@ -928,6 +929,44 @@ if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "Linux") ) endif() +if(CMake_BUILD_PCH) + target_precompile_headers(CMakeLib PRIVATE + "$<$<COMPILE_LANGUAGE:CXX>:<string$<ANGLE-R>>" + "$<$<COMPILE_LANGUAGE:CXX>:<iostream$<ANGLE-R>>" + "$<$<COMPILE_LANGUAGE:CXX>:<sstream$<ANGLE-R>>" + "$<$<COMPILE_LANGUAGE:CXX>:<iomanip$<ANGLE-R>>" + "$<$<COMPILE_LANGUAGE:CXX>:<cm/memory$<ANGLE-R>>" + "$<$<COMPILE_LANGUAGE:CXX>:<cm3p/cppdap/protocol.h$<ANGLE-R>>" + "$<$<COMPILE_LANGUAGE:CXX>:cmMakefile.h>" + "$<$<COMPILE_LANGUAGE:CXX>:cmGlobalGenerator.h>" + "$<$<COMPILE_LANGUAGE:CXX>:cmLocalGenerator.h>" + "$<$<COMPILE_LANGUAGE:CXX>:cmGeneratorTarget.h>" + "$<$<COMPILE_LANGUAGE:CXX>:cmGeneratorExpression.h>" + "$<$<COMPILE_LANGUAGE:CXX>:cmArgumentParser.h>" + "$<$<COMPILE_LANGUAGE:CXX>:cmake.h>" + "$<$<COMPILE_LANGUAGE:CXX>:cmCMakePath.h>" + "$<$<COMPILE_LANGUAGE:CXX>:cmDebuggerPipeConnection.h>" + "$<$<COMPILE_LANGUAGE:CXX>:cmCurl.h>") + + set_source_files_properties( + "LexerParser/cmFortranLexer.cxx" + PROPERTIES SKIP_PRECOMPILE_HEADERS ON) + + if(WIN32) + target_precompile_headers(CMakeLib PRIVATE + "$<$<COMPILE_LANGUAGE:CXX>:<cm3p/uv.h$<ANGLE-R>>" + "$<$<COMPILE_LANGUAGE:CXX>:cmVSSetupHelper.h>") + set_source_files_properties("LexerParser/cmFortranParser.cxx" PROPERTIES SKIP_PRECOMPILE_HEADERS ON) + else() + set_source_files_properties( + "LexerParser/cmCommandArgumentLexer.cxx" + "LexerParser/cmGccDepfileLexer.cxx" + "LexerParser/cmExprLexer.cxx" + "LexerParser/cmDependsJavaLexer.cxx" + PROPERTIES SKIP_PRECOMPILE_HEADERS ON) + endif() +endif() + # Temporary variable for tools targets set(_tools) @@ -1040,6 +1079,24 @@ target_include_directories( ) target_link_libraries(CTestLib PUBLIC CMakeLib) +if(CMake_BUILD_PCH) + target_precompile_headers(CTestLib PRIVATE + "cmDuration.h" + "cmMakefile.h" + "cmSystemTools.h" + "cmGlobalGenerator.h" + "cmake.h" + "CTest/cmCTestGenericHandler.h" + "<sstream>" + "<cm3p/uv.h>") + + if(WIN32) + target_precompile_headers(CTestLib PRIVATE "cmCurl.h" "CTest/cmCTestMultiProcessHandler.h") + else() + set_source_files_properties("LexerParser/cmCTestResourceGroupsLexer.cxx" PROPERTIES SKIP_PRECOMPILE_HEADERS ON) + endif() +endif() + # # Build CPackLib # diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 58ec04a..35d6d17 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 27) -set(CMake_VERSION_PATCH 0) +set(CMake_VERSION_PATCH 20230725) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index afd85cd..11d90c0 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -1119,8 +1119,8 @@ int cmCPackGenerator::DoPackage() // Run post-build actions cmValue postBuildScripts = this->GetOption("CPACK_POST_BUILD_SCRIPTS"); if (postBuildScripts) { - this->MakefileMap->AddDefinition("CPACK_PACKAGE_FILES", - cmJoin(this->packageFileNames, ";")); + this->MakefileMap->AddDefinition( + "CPACK_PACKAGE_FILES", cmList::to_string(this->packageFileNames)); const cmList scripts{ postBuildScripts }; for (const auto& script : scripts) { diff --git a/Source/CPack/cmCPackNuGetGenerator.cxx b/Source/CPack/cmCPackNuGetGenerator.cxx index 5de8179..aa99fb6 100644 --- a/Source/CPack/cmCPackNuGetGenerator.cxx +++ b/Source/CPack/cmCPackNuGetGenerator.cxx @@ -12,7 +12,7 @@ #include "cmCPackComponentGroup.h" #include "cmCPackLog.h" -#include "cmStringAlgorithms.h" +#include "cmList.h" #include "cmSystemTools.h" #include "cmValue.h" @@ -82,10 +82,10 @@ void cmCPackNuGetGenerator::SetupGroupComponentVariables(bool ignoreGroup) std::back_inserter(components), [](cmCPackComponent const* comp) { return comp->Name; }); this->SetOption("CPACK_NUGET_" + compGUp + "_GROUP_COMPONENTS", - cmJoin(components, ";")); + cmList::to_string(components)); } if (!groups.empty()) { - this->SetOption("CPACK_NUGET_GROUPS", cmJoin(groups, ";")); + this->SetOption("CPACK_NUGET_GROUPS", cmList::to_string(groups)); } // Handle Orphan components (components not belonging to any groups) @@ -103,7 +103,7 @@ void cmCPackNuGetGenerator::SetupGroupComponentVariables(bool ignoreGroup) } } if (!components.empty()) { - this->SetOption("CPACK_NUGET_COMPONENTS", cmJoin(components, ";")); + this->SetOption("CPACK_NUGET_COMPONENTS", cmList::to_string(components)); } } else { @@ -114,7 +114,7 @@ void cmCPackNuGetGenerator::SetupGroupComponentVariables(bool ignoreGroup) [](std::pair<std::string, cmCPackComponent> const& comp) { return comp.first; }); - this->SetOption("CPACK_NUGET_COMPONENTS", cmJoin(components, ";")); + this->SetOption("CPACK_NUGET_COMPONENTS", cmList::to_string(components)); } } diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index 90716e6..00c8fa2 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -363,11 +363,11 @@ int main(int argc, char const* const* argv) } if (!expandedPreset->Generators.empty() && generator.empty()) { - generator = cmJoin(expandedPreset->Generators, ";"); + generator = cmList::to_string(expandedPreset->Generators); } if (!expandedPreset->Configurations.empty() && cpackBuildConfig.empty()) { - cpackBuildConfig = cmJoin(expandedPreset->Configurations, ";"); + cpackBuildConfig = cmList::to_string(expandedPreset->Configurations); } definitions.insert(expandedPreset->Variables.begin(), diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index a095e5d..7d4b0a8 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -143,7 +143,6 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP( const std::string& remoteprefix, const std::string& url) { CURL* curl; - CURLcode res; FILE* ftpfile; char error_buffer[1024]; // Set Content-Type to satisfy fussy modsecurity rules. @@ -211,8 +210,6 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP( if (this->CTest->ShouldUseHTTP10()) { curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); } - // enable HTTP ERROR parsing - curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1); /* enable uploading */ curl_easy_setopt(curl, CURLOPT_UPLOAD, 1); @@ -286,7 +283,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP( upload_as += "&MD5="; if (cmIsOn(this->GetOption("InternalTest"))) { - upload_as += "bad_md5sum"; + upload_as += "ffffffffffffffffffffffffffffffff"; } else { upload_as += cmSystemTools::ComputeFileHash(local_file, cmCryptoHash::AlgoMD5); @@ -338,7 +335,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP( ::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, &chunkDebug); // Now run off and do what you've been told! - res = ::curl_easy_perform(curl); + ::curl_easy_perform(curl); if (!chunk.empty()) { cmCTestOptionalLog(this->CTest, DEBUG, @@ -359,7 +356,11 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP( // If curl failed for any reason, or checksum fails, wait and retry // - if (res != CURLE_OK || this->HasErrors) { + long response_code; + curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code); + bool successful_submission = response_code == 200; + + if (!successful_submission || this->HasErrors) { std::string retryDelay = *this->GetOption("RetryDelay"); std::string retryCount = *this->GetOption("RetryCount"); @@ -397,7 +398,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP( chunkDebug.clear(); this->HasErrors = false; - res = ::curl_easy_perform(curl); + ::curl_easy_perform(curl); if (!chunk.empty()) { cmCTestOptionalLog(this->CTest, DEBUG, @@ -408,14 +409,16 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP( this->ParseResponse(chunk); } - if (res == CURLE_OK && !this->HasErrors) { + curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code); + if (response_code == 200 && !this->HasErrors) { + successful_submission = true; break; } } } fclose(ftpfile); - if (res) { + if (!successful_submission) { cmCTestLog(this->CTest, ERROR_MESSAGE, " Error when uploading file: " << local_file << std::endl); diff --git a/Source/Checks/Curses/CMakeLists.txt b/Source/Checks/Curses/CMakeLists.txt index 0fee7ac..bc6b906 100644 --- a/Source/Checks/Curses/CMakeLists.txt +++ b/Source/Checks/Curses/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.13...3.24 FATAL_ERROR) +cmake_minimum_required(VERSION 3.13...3.26 FATAL_ERROR) project(CheckCurses C) set(CURSES_NEED_NCURSES TRUE) diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index a1b2149..77a0048 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -458,6 +458,14 @@ void cmCursesMainForm::UpdateProgress(const std::string& msg, float prog) } } +void cmCursesMainForm::Write() +{ + this->FillCacheManagerFromUI(); + this->CMakeInstance->SaveCache( + this->CMakeInstance->GetHomeOutputDirectory()); + this->LoadCache(nullptr); +} + int cmCursesMainForm::Configure(int noconfigure) { this->ResetOutputs(); @@ -471,10 +479,7 @@ int cmCursesMainForm::Configure(int noconfigure) } // always save the current gui values to disk - this->FillCacheManagerFromUI(); - this->CMakeInstance->SaveCache( - this->CMakeInstance->GetHomeOutputDirectory()); - this->LoadCache(nullptr); + this->Write(); // run the generate process this->OkToGenerate = true; @@ -794,6 +799,21 @@ void cmCursesMainForm::HandleInput() else if (key == KEY_PPAGE || key == ctrl('u')) { form_driver(this->Form, REQ_PREV_PAGE); } + // first entry + else if (key == KEY_HOME) { + form_driver(this->Form, REQ_FIRST_PAGE); + form_driver(this->Form, REQ_FIRST_FIELD); + } + // last entry + else if (key == KEY_END) { + form_driver(this->Form, REQ_LAST_PAGE); + form_driver(this->Form, REQ_LAST_FIELD); + } + // write and quit + else if (key == 'w') { + this->Write(); + break; + } // configure else if (key == 'c') { this->Configure(); @@ -854,6 +874,10 @@ void cmCursesMainForm::HandleInput() if (!this->OldSearchString.empty()) { this->JumpToCacheEntry(this->OldSearchString.c_str()); } + } else if (key == 'N') { + if (!this->OldSearchString.empty()) { + this->JumpToCacheEntry(this->OldSearchString.c_str(), true); + } } // switch advanced on/off else if (key == 't') { @@ -945,6 +969,11 @@ int cmCursesMainForm::LoadCache(const char* /*unused*/) void cmCursesMainForm::JumpToCacheEntry(const char* astr) { + this->JumpToCacheEntry(astr, false); +} + +void cmCursesMainForm::JumpToCacheEntry(const char* astr, bool reverse) +{ std::string str; if (astr) { str = cmSystemTools::LowerCase(astr); @@ -973,12 +1002,21 @@ void cmCursesMainForm::JumpToCacheEntry(const char* astr) } } } - if (static_cast<size_t>(findex) >= 3 * this->NumberOfVisibleEntries - 1) { - set_current_field(this->Form, this->Fields[2]); - } else if (new_page(this->Fields[findex + 1])) { - form_driver(this->Form, REQ_NEXT_PAGE); + if (!reverse && + static_cast<size_t>(findex) >= 3 * this->NumberOfVisibleEntries - 1) { + form_driver(this->Form, REQ_FIRST_PAGE); + form_driver(this->Form, REQ_FIRST_FIELD); + } else if (reverse && static_cast<size_t>(findex) < 3) { + form_driver(this->Form, REQ_LAST_PAGE); + form_driver(this->Form, REQ_LAST_FIELD); + } else if (this->Fields[findex + (reverse ? -3 : 1)]->page != + this->Fields[findex]->page) { + form_driver(this->Form, reverse ? REQ_PREV_PAGE : REQ_NEXT_PAGE); + if (reverse) { + form_driver(this->Form, REQ_LAST_FIELD); + } } else { - form_driver(this->Form, REQ_NEXT_FIELD); + form_driver(this->Form, reverse ? REQ_PREV_FIELD : REQ_NEXT_FIELD); } cur = current_field(this->Form); findex = field_index(cur); @@ -1040,15 +1078,21 @@ const char* cmCursesMainForm::s_ConstHelpMessage = "hit 'g' to have CMake generate all the build files (i.e. makefiles or " "project files) and exit. " "At any point during the process, you can exit ccmake with 'q'. However, " - "this will not generate/change any build files.\n\n" + "this will not generate/change any build files. Additionally, you can exit " + "ccmake with 'w' to write changes to the cache file without generating or " + "changing the build files.\n\n" "ccmake KEYS:\n\n" "Navigation: " "You can use the arrow keys and page up, down to navigate the options. " - "Alternatively, you can use the following keys: \n" + "Additionally, you can use the following keys: \n" " C-n or j : next option\n" " C-p or k : previous options\n" " C-d : down one page\n" - " C-u : up one page\n\n" + " C-u : up one page\n" + " Home : jump to first option\n" + " End : jump to last option\n" + " n : next search result\n" + " N : previous search result\n\n" "Editing options: " "To change an option press enter or return. If the current options is a " "boolean, this will toggle its value. " diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h index 112b7e8..1ce75e7 100644 --- a/Source/CursesDialog/cmCursesMainForm.h +++ b/Source/CursesDialog/cmCursesMainForm.h @@ -87,6 +87,11 @@ public: void AddError(const std::string& message, const char* title) override; /** + * Write files to cache file without reconfiguring. + */ + void Write(); + + /** * Used to do a configure. If argument is specified, it does only the check * and not configure. */ @@ -123,6 +128,7 @@ protected: // Jump to the cache entry whose name matches the string. void JumpToCacheEntry(const char* str); + void JumpToCacheEntry(const char* str, bool reverse); // Clear and reset the output log and state void ResetOutputs(); diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx index b1398db..044b5df 100644 --- a/Source/cmAddCustomCommandCommand.cxx +++ b/Source/cmAddCustomCommandCommand.cxx @@ -19,6 +19,7 @@ #include "cmPolicies.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" +#include "cmValue.h" bool cmAddCustomCommandCommand(std::vector<std::string> const& args, cmExecutionStatus& status) @@ -39,6 +40,7 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args, std::string working; std::string depfile; std::string job_pool; + std::string job_server_aware; std::string comment_buffer; const char* comment = nullptr; std::vector<std::string> depends; @@ -78,6 +80,7 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args, doing_working_directory, doing_depfile, doing_job_pool, + doing_job_server_aware, doing_nothing }; @@ -95,6 +98,7 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args, MAKE_STATIC_KEYWORD(DEPFILE); MAKE_STATIC_KEYWORD(IMPLICIT_DEPENDS); MAKE_STATIC_KEYWORD(JOB_POOL); + MAKE_STATIC_KEYWORD(JOB_SERVER_AWARE); MAKE_STATIC_KEYWORD(MAIN_DEPENDENCY); MAKE_STATIC_KEYWORD(OUTPUT); MAKE_STATIC_KEYWORD(OUTPUTS); @@ -126,6 +130,7 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args, keyPRE_BUILD, keyPRE_LINK, keySOURCE, + keyJOB_SERVER_AWARE, keyTARGET, keyUSES_TERMINAL, keyVERBATIM, @@ -190,6 +195,8 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args, } } else if (copy == keyJOB_POOL) { doing = doing_job_pool; + } else if (copy == keyJOB_SERVER_AWARE) { + doing = doing_job_server_aware; } } else { std::string filename; @@ -226,6 +233,9 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args, case doing_job_pool: job_pool = copy; break; + case doing_job_server_aware: + job_server_aware = copy; + break; case doing_working_directory: working = copy; break; @@ -324,6 +334,15 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args, return false; } + // If using a GNU Make generator and `JOB_SERVER_AWARE` is set then + // prefix all commands with '+'. + if (cmIsOn(job_server_aware) && + mf.GetGlobalGenerator()->IsGNUMakeJobServerAware()) { + for (auto& commandLine : commandLines) { + commandLine.insert(commandLine.begin(), "+"); + } + } + // Choose which mode of the command to use. auto cc = cm::make_unique<cmCustomCommand>(); cc->SetByproducts(byproducts); diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx index a246d06..6339062 100644 --- a/Source/cmAddCustomTargetCommand.cxx +++ b/Source/cmAddCustomTargetCommand.cxx @@ -17,6 +17,7 @@ #include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include "cmTarget.h" +#include "cmValue.h" bool cmAddCustomTargetCommand(std::vector<std::string> const& args, cmExecutionStatus& status) @@ -54,6 +55,7 @@ bool cmAddCustomTargetCommand(std::vector<std::string> const& args, const char* comment = nullptr; std::vector<std::string> sources; std::string job_pool; + std::string JOB_SERVER_AWARE; // Keep track of parser state. enum tdoing @@ -65,6 +67,7 @@ bool cmAddCustomTargetCommand(std::vector<std::string> const& args, doing_comment, doing_source, doing_job_pool, + doing_JOB_SERVER_AWARE, doing_nothing }; tdoing doing = doing_command; @@ -102,6 +105,8 @@ bool cmAddCustomTargetCommand(std::vector<std::string> const& args, doing = doing_comment; } else if (copy == "JOB_POOL") { doing = doing_job_pool; + } else if (copy == "JOB_SERVER_AWARE") { + doing = doing_JOB_SERVER_AWARE; } else if (copy == "COMMAND") { doing = doing_command; @@ -148,6 +153,9 @@ bool cmAddCustomTargetCommand(std::vector<std::string> const& args, case doing_job_pool: job_pool = copy; break; + case doing_JOB_SERVER_AWARE: + JOB_SERVER_AWARE = copy; + break; default: status.SetError("Wrong syntax. Unknown type of argument."); return false; @@ -212,6 +220,15 @@ bool cmAddCustomTargetCommand(std::vector<std::string> const& args, return false; } + // If using a GNU Make generator and `JOB_SERVER_AWARE` is set then + // prefix all commands with '+'. + if (cmIsOn(JOB_SERVER_AWARE) && + mf.GetGlobalGenerator()->IsGNUMakeJobServerAware()) { + for (auto& commandLine : commandLines) { + commandLine.insert(commandLine.begin(), "+"); + } + } + // Add the utility target to the makefile. auto cc = cm::make_unique<cmCustomCommand>(); cc->SetWorkingDirectory(working_directory.c_str()); diff --git a/Source/cmAuxSourceDirectoryCommand.cxx b/Source/cmAuxSourceDirectoryCommand.cxx index 35f4c88..b2e3cad 100644 --- a/Source/cmAuxSourceDirectoryCommand.cxx +++ b/Source/cmAuxSourceDirectoryCommand.cxx @@ -11,6 +11,7 @@ #include "cmsys/Directory.hxx" #include "cmExecutionStatus.h" +#include "cmList.h" #include "cmMakefile.h" #include "cmSourceFile.h" #include "cmStringAlgorithms.h" @@ -67,7 +68,7 @@ bool cmAuxSourceDirectoryCommand(std::vector<std::string> const& args, if (!sourceListValue.empty()) { sourceListValue += ";"; } - sourceListValue += cmJoin(files, ";"); + sourceListValue += cmList::to_string(files); mf.AddDefinition(args[1], sourceListValue); return true; } diff --git a/Source/cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool.cxx b/Source/cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool.cxx index 566e4a4..8043f82 100644 --- a/Source/cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool.cxx +++ b/Source/cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool.cxx @@ -10,6 +10,7 @@ #include "cmRuntimeDependencyArchive.h" #include "cmSystemTools.h" #include "cmUVProcessChain.h" +#include "cmUVStream.h" cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool:: cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool( @@ -35,7 +36,7 @@ bool cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool::GetFileInfo( builder.AddCommand(command); auto process = builder.Start(); - if (!process.Valid()) { + if (!process.Valid() || process.GetStatus(0).SpawnResult != 0) { std::ostringstream e; e << "Failed to start objdump process for:\n " << file; this->SetError(e.str()); @@ -46,7 +47,8 @@ bool cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool::GetFileInfo( static const cmsys::RegularExpression neededRegex("^ *NEEDED *([^\n]*)$"); static const cmsys::RegularExpression rpathRegex("^ *RPATH *([^\n]*)$"); static const cmsys::RegularExpression runpathRegex("^ *RUNPATH *([^\n]*)$"); - while (std::getline(*process.OutputStream(), line)) { + cmUVPipeIStream output(process.GetLoop(), process.OutputStream()); + while (std::getline(output, line)) { cmsys::RegularExpressionMatch match; if (neededRegex.find(line.c_str(), match)) { needed.push_back(match.match(1)); @@ -73,8 +75,7 @@ bool cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool::GetFileInfo( this->SetError(e.str()); return false; } - auto status = process.GetStatus(); - if (!status[0] || status[0]->ExitStatus != 0) { + if (process.GetStatus(0).ExitStatus != 0) { std::ostringstream e; e << "Failed to run objdump on:\n " << file; this->SetError(e.str()); diff --git a/Source/cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.cxx b/Source/cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.cxx index 6d97720..4c35841 100644 --- a/Source/cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.cxx +++ b/Source/cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.cxx @@ -9,6 +9,7 @@ #include "cmRuntimeDependencyArchive.h" #include "cmUVProcessChain.h" +#include "cmUVStream.h" cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool:: cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool( @@ -34,7 +35,7 @@ bool cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool::GetFileInfo( .AddCommand(command); auto process = builder.Start(); - if (!process.Valid()) { + if (!process.Valid() || process.GetStatus(0).SpawnResult != 0) { std::ostringstream e; e << "Failed to start otool process for:\n " << file; this->SetError(e.str()); @@ -49,11 +50,12 @@ bool cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool::GetFileInfo( "^ *path (.*) \\(offset [0-9]+\\)$"); static const cmsys::RegularExpression nameRegex( "^ *name (.*) \\(offset [0-9]+\\)$"); - while (std::getline(*process.OutputStream(), line)) { + cmUVPipeIStream output(process.GetLoop(), process.OutputStream()); + while (std::getline(output, line)) { cmsys::RegularExpressionMatch cmdMatch; if (rpathRegex.find(line.c_str(), cmdMatch)) { - if (!std::getline(*process.OutputStream(), line) || - !std::getline(*process.OutputStream(), line)) { + // NOLINTNEXTLINE(misc-redundant-expression) + if (!std::getline(output, line) || !std::getline(output, line)) { this->SetError("Invalid output from otool"); return false; } @@ -66,8 +68,8 @@ bool cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool::GetFileInfo( return false; } } else if (loadDylibRegex.find(line.c_str(), cmdMatch)) { - if (!std::getline(*process.OutputStream(), line) || - !std::getline(*process.OutputStream(), line)) { + // NOLINTNEXTLINE(misc-redundant-expression) + if (!std::getline(output, line) || !std::getline(output, line)) { this->SetError("Invalid output from otool"); return false; } @@ -88,8 +90,7 @@ bool cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool::GetFileInfo( this->SetError(e.str()); return false; } - auto status = process.GetStatus(); - if (!status[0] || status[0]->ExitStatus != 0) { + if (process.GetStatus(0).ExitStatus != 0) { std::ostringstream e; e << "Failed to run otool on:\n " << file; this->SetError(e.str()); diff --git a/Source/cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool.cxx b/Source/cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool.cxx index f342884..cd21140 100644 --- a/Source/cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool.cxx +++ b/Source/cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool.cxx @@ -9,6 +9,7 @@ #include "cmRuntimeDependencyArchive.h" #include "cmUVProcessChain.h" +#include "cmUVStream.h" cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool:: cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool( @@ -33,7 +34,7 @@ bool cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool::GetFileInfo( builder.AddCommand(command); auto process = builder.Start(); - if (!process.Valid()) { + if (!process.Valid() || process.GetStatus(0).SpawnResult != 0) { std::ostringstream e; e << "Failed to start dumpbin process for:\n " << file; this->SetError(e.str()); @@ -43,7 +44,8 @@ bool cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool::GetFileInfo( std::string line; static const cmsys::RegularExpression regex( "^ ([^\n]*\\.[Dd][Ll][Ll])\r$"); - while (std::getline(*process.OutputStream(), line)) { + cmUVPipeIStream output(process.GetLoop(), process.OutputStream()); + while (std::getline(output, line)) { cmsys::RegularExpressionMatch match; if (regex.find(line.c_str(), match)) { needed.push_back(match.match(1)); @@ -56,8 +58,7 @@ bool cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool::GetFileInfo( this->SetError(e.str()); return false; } - auto status = process.GetStatus(); - if (!status[0] || status[0]->ExitStatus != 0) { + if (process.GetStatus(0).ExitStatus != 0) { std::ostringstream e; e << "Failed to run dumpbin on:\n " << file; this->SetError(e.str()); diff --git a/Source/cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.cxx b/Source/cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.cxx index f14de55..d95da95 100644 --- a/Source/cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.cxx +++ b/Source/cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.cxx @@ -10,6 +10,7 @@ #include "cmRuntimeDependencyArchive.h" #include "cmSystemTools.h" #include "cmUVProcessChain.h" +#include "cmUVStream.h" cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool:: cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool( @@ -34,7 +35,7 @@ bool cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool::GetFileInfo( builder.AddCommand(command); auto process = builder.Start(); - if (!process.Valid()) { + if (!process.Valid() || process.GetStatus(0).SpawnResult != 0) { std::ostringstream e; e << "Failed to start objdump process for:\n " << file; this->SetError(e.str()); @@ -44,7 +45,8 @@ bool cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool::GetFileInfo( std::string line; static const cmsys::RegularExpression regex( "^\t*DLL Name: ([^\n]*\\.[Dd][Ll][Ll])$"); - while (cmSystemTools::GetLineFromStream(*process.OutputStream(), line)) { + cmUVPipeIStream output(process.GetLoop(), process.OutputStream()); + while (cmSystemTools::GetLineFromStream(output, line)) { cmsys::RegularExpressionMatch match; if (regex.find(line.c_str(), match)) { needed.push_back(match.match(1)); @@ -57,8 +59,7 @@ bool cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool::GetFileInfo( this->SetError(e.str()); return false; } - auto status = process.GetStatus(); - if (!status[0] || status[0]->ExitStatus != 0) { + if (process.GetStatus(0).ExitStatus != 0) { std::ostringstream e; e << "Failed to run objdump on:\n " << file; this->SetError(e.str()); diff --git a/Source/cmCMakeHostSystemInformationCommand.cxx b/Source/cmCMakeHostSystemInformationCommand.cxx index 1c00f15..81ed41f 100644 --- a/Source/cmCMakeHostSystemInformationCommand.cxx +++ b/Source/cmCMakeHostSystemInformationCommand.cxx @@ -529,12 +529,12 @@ bool QueryWindowsRegistry(Range args, cmExecutionStatus& status, if (arguments.ValueNames) { auto result = registry.GetValueNames(key, view); if (result) { - makefile.AddDefinition(variable, cmJoin(*result, ";"_s)); + makefile.AddDefinition(variable, cmList::to_string(*result)); } } else if (arguments.SubKeys) { auto result = registry.GetSubKeys(key, view); if (result) { - makefile.AddDefinition(variable, cmJoin(*result, ";"_s)); + makefile.AddDefinition(variable, cmList::to_string(*result)); } } else { auto result = diff --git a/Source/cmCMakeLanguageCommand.cxx b/Source/cmCMakeLanguageCommand.cxx index c7e9209..d65543a 100644 --- a/Source/cmCMakeLanguageCommand.cxx +++ b/Source/cmCMakeLanguageCommand.cxx @@ -17,6 +17,7 @@ #include "cmArgumentParserTypes.h" #include "cmDependencyProvider.h" #include "cmExecutionStatus.h" +#include "cmExperimental.h" #include "cmGlobalGenerator.h" #include "cmListFileCache.h" #include "cmMakefile.h" @@ -328,6 +329,46 @@ bool cmCMakeLanguageCommandGET_MESSAGE_LOG_LEVEL( makefile.AddDefinition(outputVariable, outputValue); return true; } + +bool cmCMakeLanguageCommandGET_EXPERIMENTAL_FEATURE_ENABLED( + std::vector<cmListFileArgument> const& args, cmExecutionStatus& status) +{ + cmMakefile& makefile = status.GetMakefile(); + std::vector<std::string> expandedArgs; + makefile.ExpandArguments(args, expandedArgs); + + if (expandedArgs.size() != 3) { + return FatalError(status, + "sub-command GET_EXPERIMENTAL_FEATURE_ENABLED expects " + "exactly two arguments"); + } + + auto const& featureName = expandedArgs[1]; + auto const& variableName = expandedArgs[2]; + + auto feature = cmExperimental::Feature::Sentinel; + for (std::size_t i = 0; + i < static_cast<std::size_t>(cmExperimental::Feature::Sentinel); i++) { + if (cmExperimental::DataForFeature(static_cast<cmExperimental::Feature>(i)) + .Name == featureName) { + feature = static_cast<cmExperimental::Feature>(i); + break; + } + } + if (feature == cmExperimental::Feature::Sentinel) { + return FatalError(status, + cmStrCat("Experimental feature name \"", featureName, + "\" does not exist.")); + } + + if (cmExperimental::HasSupportEnabled(makefile, feature)) { + makefile.AddDefinition(variableName, "TRUE"); + } else { + makefile.AddDefinition(variableName, "FALSE"); + } + + return true; +} } bool cmCMakeLanguageCommand(std::vector<cmListFileArgument> const& args, @@ -480,5 +521,10 @@ bool cmCMakeLanguageCommand(std::vector<cmListFileArgument> const& args, return cmCMakeLanguageCommandGET_MESSAGE_LOG_LEVEL(args, status); } + if (expArgs[expArg] == "GET_EXPERIMENTAL_FEATURE_ENABLED") { + return cmCMakeLanguageCommandGET_EXPERIMENTAL_FEATURE_ENABLED(args, + status); + } + return FatalError(status, "called with unknown meta-operation"); } diff --git a/Source/cmCMakePath.cxx b/Source/cmCMakePath.cxx index 73321c6..5080f58 100644 --- a/Source/cmCMakePath.cxx +++ b/Source/cmCMakePath.cxx @@ -15,6 +15,8 @@ #include <cm/string_view> #if defined(_WIN32) +# include <cmext/string_view> + # include "cmStringAlgorithms.h" #endif diff --git a/Source/cmCMakePath.h b/Source/cmCMakePath.h index 15aa30c..a42ac98 100644 --- a/Source/cmCMakePath.h +++ b/Source/cmCMakePath.h @@ -12,7 +12,10 @@ #include <cm/filesystem> #include <cm/string_view> #include <cm/type_traits> -#include <cmext/string_view> + +namespace cm { +class static_string_view; +} namespace detail { #if defined(__SUNPRO_CC) && defined(__sparc) @@ -123,11 +126,29 @@ public: : Path(FormatPath(source, fmt)) { } + cmCMakePath(const char* source, format fmt = generic_format) noexcept + : Path(FormatPath(cm::string_view{ source }, fmt)) + { + } +#if defined(__SUNPRO_CC) && defined(__sparc) + // Oracle DeveloperStudio C++ compiler on Solaris/Sparc is confused when + // standard methods and templates use the same name. The template is selected + // rather than the standard one regardless the arguments of the method. + cmCMakePath(const std::string& source, format fmt = generic_format) + : Path(FormatPath(source, fmt)) + { + } + cmCMakePath(std::string&& source, format fmt = generic_format) + : Path(FormatPath(std::move(source), fmt)) + { + } +#else template <typename Source, typename = enable_if_move_pathable<Source>> cmCMakePath(Source source, format fmt = generic_format) : Path(FormatPath(std::move(source), fmt)) { } +#endif template <typename Source, typename = enable_if_move_pathable<Source>> cmCMakePath& Assign(Source&& source) @@ -156,6 +177,41 @@ public: } return *this; } +#if defined(__SUNPRO_CC) && defined(__sparc) + // Oracle DeveloperStudio C++ compiler on Solaris/Sparc is confused when + // standard methods and templates use the same name. The template is selected + // rather than the standard one regardless the arguments of the method. + cmCMakePath& operator=(cm::filesystem::path&& source) + { + this->Assign(std::forward<cm::filesystem::path>(source)); + return *this; + } + cmCMakePath& operator=(std::string&& source) + { + this->Assign(std::forward<std::string>(source)); + return *this; + } + cmCMakePath& operator=(const cm::filesystem::path& source) + { + this->Assign(source); + return *this; + } + cmCMakePath& operator=(const std::string& source) + { + this->Assign(source); + return *this; + } + cmCMakePath& operator=(const cm::string_view source) + { + this->Assign(source); + return *this; + } + cmCMakePath& operator=(const char* source) + { + this->Assign(cm::string_view{ source }); + return *this; + } +#else template <typename Source, typename = enable_if_move_pathable<Source>> cmCMakePath& operator=(Source&& source) { @@ -168,6 +224,7 @@ public: this->Assign(source); return *this; } +#endif // Concatenation cmCMakePath& Append(const cmCMakePath& path) @@ -182,12 +239,29 @@ public: this->Path = this->Path.generic_string(); return *this; } - +#if defined(__SUNPRO_CC) && defined(__sparc) + // Oracle DeveloperStudio C++ compiler on Solaris/Sparc is confused when + // standard methods and templates use the same name. The template is selected + // rather than the standard one regardless the arguments of the method. + cmCMakePath& Append(const std::string& source) + { + return this->Append(cm::filesystem::path(source)); + } + cmCMakePath& Append(cm::string_view source) + { + return this->Append(cm::filesystem::path(source)); + } + cmCMakePath& Append(const char* source) + { + return this->Append(cm::filesystem::path(cm::string_view{ source })); + } +#else template <typename Source, typename = enable_if_pathable<Source>> cmCMakePath& Append(const Source& source) { return this->Append(cm::filesystem::path(source)); } +#endif cmCMakePath& operator/=(const cmCMakePath& path) { @@ -204,17 +278,38 @@ public: this->Path += path.Path; return *this; } - cmCMakePath& Concat(cm::static_string_view source) + cmCMakePath& Concat(cm::string_view source) { - this->Path.concat(std::string(source)); + this->Path.operator+=(std::string(source)); return *this; } +#if defined(__SUNPRO_CC) && defined(__sparc) + // Oracle DeveloperStudio C++ compiler on Solaris/Sparc is confused when + // standard methods and templates use the same name. The template is selected + // rather than the standard one regardless the arguments of the method. + cmCMakePath& Concat(const cm::filesystem::path& source) + { + this->Path.operator+=(source); + return *this; + } + cmCMakePath& Concat(const std::string& source) + { + this->Path.operator+=(source); + return *this; + } + cmCMakePath& Concat(const char* source) + { + this->Path.operator+=(source); + return *this; + } +#else template <typename Source, typename = enable_if_pathable<Source>> cmCMakePath& Concat(const Source& source) { - this->Path.concat(source); + this->Path.operator+=(source); return *this; } +#endif cmCMakePath& operator+=(const cmCMakePath& path) { @@ -242,6 +337,32 @@ public: } return *this; } +#if defined(__SUNPRO_CC) && defined(__sparc) + // Oracle DeveloperStudio C++ compiler on Solaris/Sparc is confused when + // standard methods and templates use the same name. The template is selected + // rather than the standard one regardless the arguments of the method. + cmCMakePath& ReplaceFileName(const cm::filesystem::path& filename) + { + if (this->Path.has_filename()) { + this->Path.replace_filename(filename); + } + return *this; + } + cmCMakePath& ReplaceFileName(const std::string& filename) + { + if (this->Path.has_filename()) { + this->Path.replace_filename(filename); + } + return *this; + } + cmCMakePath& ReplaceFileName(cm::string_view filename) + { + if (this->Path.has_filename()) { + this->Path.replace_filename(filename); + } + return *this; + } +#else template <typename Source, typename = enable_if_pathable<Source>> cmCMakePath& ReplaceFileName(const Source& filename) { @@ -250,18 +371,40 @@ public: } return *this; } +#endif cmCMakePath& ReplaceExtension(const cmCMakePath& extension = cmCMakePath()) { this->Path.replace_extension(extension.Path); return *this; } +#if defined(__SUNPRO_CC) && defined(__sparc) + // Oracle DeveloperStudio C++ compiler on Solaris/Sparc is confused when + // standard methods and templates use the same name. The template is selected + // rather than the standard one regardless the arguments of the method. + cmCMakePath& ReplaceExtension(const cm::filesystem::path& extension) + { + this->Path.replace_extension(extension); + return *this; + } + cmCMakePath& ReplaceExtension(const std::string& extension) + { + this->Path.replace_extension(extension); + return *this; + } + cmCMakePath& ReplaceExtension(const cm::string_view extension) + { + this->Path.replace_extension(extension); + return *this; + } +#else template <typename Source, typename = enable_if_pathable<Source>> cmCMakePath& ReplaceExtension(const Source& extension) { this->Path.replace_extension(extension); return *this; } +#endif cmCMakePath& ReplaceWideExtension( const cmCMakePath& extension = cmCMakePath()) @@ -269,11 +412,26 @@ public: return this->ReplaceWideExtension( static_cast<cm::string_view>(extension.Path.string())); } + cmCMakePath& ReplaceWideExtension(const cm::filesystem::path& extension) + { + return this->ReplaceWideExtension( + static_cast<cm::string_view>(extension.string())); + } +#if defined(__SUNPRO_CC) && defined(__sparc) + // Oracle DeveloperStudio C++ compiler on Solaris/Sparc is confused when + // standard methods and templates use the same name. The template is selected + // rather than the standard one regardless the arguments of the method. + cmCMakePath& ReplaceWideExtension(const std::string& extension) + { + return this->ReplaceWideExtension(cm::string_view{ extension }); + } +#else template <typename Source, typename = enable_if_pathable<Source>> cmCMakePath& ReplaceWideExtension(const Source& extension) { - return this->ReplaceWideExtension(cm::string_view(extension)); + return this->ReplaceWideExtension(extension); } +#endif cmCMakePath& ReplaceWideExtension(cm::string_view extension); cmCMakePath& RemoveExtension() @@ -355,12 +513,25 @@ public: // Windows) so convert back to '/' return path.generic_string(); } +#if defined(__SUNPRO_CC) && defined(__sparc) + // Oracle DeveloperStudio C++ compiler on Solaris/Sparc is confused when + // standard methods and templates use the same name. The template is selected + // rather than the standard one regardless the arguments of the method. + cmCMakePath Relative(const std::string& base) const + { + return this->Relative(cm::filesystem::path(base)); + } + cmCMakePath Relative(cm::string_view base) const + { + return this->Relative(cm::filesystem::path(base)); + } +#else template <typename Source, typename = enable_if_pathable<Source>> cmCMakePath Relative(const Source& base) const { return this->Relative(cm::filesystem::path(base)); } - +#endif cmCMakePath Proximate(const cmCMakePath& base) const { return this->Proximate(base.Path); @@ -372,21 +543,49 @@ public: // Windows) so convert back to '/' return path.generic_string(); } +#if defined(__SUNPRO_CC) && defined(__sparc) + // Oracle DeveloperStudio C++ compiler on Solaris/Sparc is confused when + // standard methods and templates use the same name. The template is selected + // rather than the standard one regardless the arguments of the method. + cmCMakePath Proximate(const std::string& base) const + { + return this->Proximate(cm::filesystem::path(base)); + } + cmCMakePath Proximate(cm::string_view base) const + { + return this->Proximate(cm::filesystem::path(base)); + } +#else template <typename Source, typename = enable_if_pathable<Source>> cmCMakePath Proximate(const Source& base) const { return this->Proximate(cm::filesystem::path(base)); } +#endif cmCMakePath Absolute(const cmCMakePath& base) const { return this->Absolute(base.Path); } +#if defined(__SUNPRO_CC) && defined(__sparc) + // Oracle DeveloperStudio C++ compiler on Solaris/Sparc is confused when + // standard methods and templates use the same name. The template is selected + // rather than the standard one regardless the arguments of the method. + cmCMakePath Absolute(const std::string& base) const + { + return this->Absolute(cm::filesystem::path(base)); + } + cmCMakePath Absolute(cm::string_view base) const + { + return this->Absolute(cm::filesystem::path(base)); + } +#else template <typename Source, typename = enable_if_pathable<Source>> cmCMakePath Absolute(const Source& base) const { return this->Absolute(cm::filesystem::path(base)); } +#endif cmCMakePath Absolute(const cm::filesystem::path& base) const; // Comparison diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index ebbb88f..a50ce11 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -1589,7 +1589,9 @@ void cmComputeLinkInformation::AddTargetItem(LinkEntry const& entry) this->OldLinkDirItems.push_back(item.Value); } - if (target->IsFrameworkOnApple()) { + const bool isImportedFrameworkFolderOnApple = + target->IsImportedFrameworkFolderOnApple(this->Config); + if (target->IsFrameworkOnApple() || isImportedFrameworkFolderOnApple) { // Add the framework directory and the framework item itself auto fwDescriptor = this->GlobalGenerator->SplitFrameworkPath( item.Value, cmGlobalGenerator::FrameworkFormat::Extended); @@ -1607,16 +1609,33 @@ void cmComputeLinkInformation::AddTargetItem(LinkEntry const& entry) } if (this->GlobalGenerator->IsXcode()) { - this->Items.emplace_back( - item, ItemIsPath::Yes, target, - this->FindLibraryFeature(entry.Feature == DEFAULT - ? "__CMAKE_LINK_FRAMEWORK" - : entry.Feature)); + if (isImportedFrameworkFolderOnApple) { + if (entry.Feature == DEFAULT) { + this->AddLibraryFeature("FRAMEWORK"); + this->Items.emplace_back(item, ItemIsPath::Yes, target, + this->FindLibraryFeature("FRAMEWORK")); + } else { + this->Items.emplace_back(item, ItemIsPath::Yes, target, + this->FindLibraryFeature(entry.Feature)); + } + } else { + this->Items.emplace_back( + item, ItemIsPath::Yes, target, + this->FindLibraryFeature(entry.Feature == DEFAULT + ? "__CMAKE_LINK_FRAMEWORK" + : entry.Feature)); + } } else { if (cmHasSuffix(entry.Feature, "FRAMEWORK"_s)) { this->Items.emplace_back(fwDescriptor->GetLinkName(), ItemIsPath::Yes, target, this->FindLibraryFeature(entry.Feature)); + } else if (entry.Feature == DEFAULT && + isImportedFrameworkFolderOnApple) { + this->AddLibraryFeature("FRAMEWORK"); + this->Items.emplace_back(fwDescriptor->GetLinkName(), ItemIsPath::Yes, + target, + this->FindLibraryFeature("FRAMEWORK")); } else { this->Items.emplace_back( item, ItemIsPath::Yes, target, @@ -2232,16 +2251,20 @@ void cmComputeLinkInformation::AddLibraryRuntimeInfo( if (target->GetType() != cmStateEnums::SHARED_LIBRARY) { return; } + auto const* info = target->GetImportInfo(this->Config); // Try to get the soname of the library. Only files with this name // could possibly conflict. - std::string soName = target->GetSOName(this->Config); - const char* soname = soName.empty() ? nullptr : soName.c_str(); - - // Include this library in the runtime path ordering. - this->OrderRuntimeSearchPath->AddRuntimeLibrary(fullPath, soname); - if (this->LinkWithRuntimePath) { - this->OrderLinkerSearchPath->AddRuntimeLibrary(fullPath, soname); + const char* soname = + (!info || info->SOName.empty()) ? nullptr : info->SOName.c_str(); + + // If this shared library has a known runtime artifact (IMPORTED_LOCATION), + // include its location in the runtime path ordering. + if (!info || !info->Location.empty()) { + this->OrderRuntimeSearchPath->AddRuntimeLibrary(fullPath, soname); + if (this->LinkWithRuntimePath) { + this->OrderLinkerSearchPath->AddRuntimeLibrary(fullPath, soname); + } } } diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 7d4ab50..0a1ed30 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -18,6 +18,7 @@ #include "cmArgumentParser.h" #include "cmConfigureLog.h" +#include "cmExperimental.h" #include "cmExportTryCompileFileGenerator.h" #include "cmGlobalGenerator.h" #include "cmList.h" @@ -231,7 +232,7 @@ Arguments cmCoreTryCompile::ParseArgs( !unparsedArguments.empty()) { std::string m = "Unknown arguments:"; for (const auto& i : unparsedArguments) { - m = cmStrCat(m, "\n \"", i, "\""); + m = cmStrCat(m, "\n \"", i, '"'); } this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, m); } @@ -345,7 +346,7 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode( this->Makefile->IssueMessage( MessageType::FATAL_ERROR, cmStrCat("<bindir> is not an absolute path:\n '", - *arguments.BinaryDirectory, "'")); + *arguments.BinaryDirectory, '\'')); return cm::nullopt; } this->BinaryDirectory = *arguments.BinaryDirectory; @@ -377,7 +378,7 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode( cmStrCat("Only libraries may be used as try_compile or try_run " "IMPORTED LINK_LIBRARIES. Got ", tgt->GetName(), " of type ", - cmState::GetTargetTypeName(tgt->GetType()), ".")); + cmState::GetTargetTypeName(tgt->GetType()), '.')); return cm::nullopt; } if (tgt->IsImported()) { @@ -478,11 +479,11 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode( std::map<std::string, std::string> cmakeVariables; - std::string outFileName = this->BinaryDirectory + "/CMakeLists.txt"; + std::string outFileName = cmStrCat(this->BinaryDirectory, "/CMakeLists.txt"); // which signature are we using? If we are using var srcfile bindir if (this->SrcFileSignature) { // remove any CMakeCache.txt files so we will have a clean test - std::string ccFile = this->BinaryDirectory + "/CMakeCache.txt"; + std::string ccFile = cmStrCat(this->BinaryDirectory, "/CMakeCache.txt"); cmSystemTools::RemoveFile(ccFile); // Choose sources. @@ -525,12 +526,12 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode( if (!cmSystemTools::GetFilenamePath(dst).empty()) { const auto& msg = - cmStrCat("SOURCE_FROM_FILE given invalid filename \"", dst, "\""); + cmStrCat("SOURCE_FROM_FILE given invalid filename \"", dst, '"'); this->Makefile->IssueMessage(MessageType::FATAL_ERROR, msg); return cm::nullopt; } - auto dstPath = cmStrCat(this->BinaryDirectory, "/", dst); + auto dstPath = cmStrCat(this->BinaryDirectory, '/', dst); auto const result = cmSystemTools::CopyFileAlways(src, dstPath); if (!result.IsSuccess()) { const auto& msg = cmStrCat("SOURCE_FROM_FILE failed to copy \"", src, @@ -554,10 +555,13 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode( testLangs.insert(lang); } else { std::ostringstream err; - err << "Unknown extension \"" << ext << "\" for file\n" - << " " << si << "\n" - << "try_compile() works only for enabled languages. " - << "Currently these are:\n "; + err << "Unknown extension \"" << ext + << "\" for file\n" + " " + << si + << "\n" + "try_compile() works only for enabled languages. " + "Currently these are:\n "; std::vector<std::string> langs; gg->GetEnabledLanguages(langs); err << cmJoin(langs, " "); @@ -586,7 +590,7 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode( std::ostringstream e; /* clang-format off */ e << "Failed to open\n" - << " " << outFileName << "\n" + " " << outFileName << "\n" << cmSystemTools::GetLastSystemError(); /* clang-format on */ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str()); @@ -654,9 +658,9 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode( std::string projectLangs; for (std::string const& li : testLangs) { - projectLangs += " " + li; + projectLangs += cmStrCat(' ', li); std::string rulesOverrideBase = "CMAKE_USER_MAKE_RULES_OVERRIDE"; - std::string rulesOverrideLang = cmStrCat(rulesOverrideBase, "_", li); + std::string rulesOverrideLang = cmStrCat(rulesOverrideBase, '_', li); if (cmValue rulesOverridePath = this->Makefile->GetDefinition(rulesOverrideLang)) { fprintf(fout, "set(%s \"%s\")\n", rulesOverrideLang.c_str(), @@ -689,7 +693,7 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode( } fprintf(fout, "set(CMAKE_VERBOSE_MAKEFILE 1)\n"); for (std::string const& li : testLangs) { - std::string langFlags = "CMAKE_" + li + "_FLAGS"; + std::string langFlags = cmStrCat("CMAKE_", li, "_FLAGS"); cmValue flags = this->Makefile->GetDefinition(langFlags); fprintf(fout, "set(CMAKE_%s_FLAGS %s)\n", li.c_str(), cmOutputConverter::EscapeForCMake(*flags).c_str()); @@ -793,10 +797,10 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode( } if (!targets.empty()) { - std::string fname = "/" + std::string(targetName) + "Targets.cmake"; + std::string fname = cmStrCat('/', targetName, "Targets.cmake"); cmExportTryCompileFileGenerator tcfg(gg, targets, this->Makefile, testLangs); - tcfg.SetExportFile((this->BinaryDirectory + fname).c_str()); + tcfg.SetExportFile(cmStrCat(this->BinaryDirectory, fname).c_str()); tcfg.SetConfig(tcConfig); if (!tcfg.GenerateImportFile()) { @@ -964,7 +968,7 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode( if (arguments.LinkLibraries) { std::string libsToLink = " "; for (std::string const& i : *arguments.LinkLibraries) { - libsToLink += "\"" + cmTrimWhitespace(i) + "\" "; + libsToLink += cmStrCat('"', cmTrimWhitespace(i), "\" "); } fprintf(fout, "target_link_libraries(%s %s)\n", targetName.c_str(), libsToLink.c_str()); @@ -1063,14 +1067,25 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode( if (cmValue tcArchs = this->Makefile->GetDefinition( kCMAKE_TRY_COMPILE_OSX_ARCHITECTURES)) { vars.erase(kCMAKE_OSX_ARCHITECTURES); - std::string flag = "-DCMAKE_OSX_ARCHITECTURES=" + *tcArchs; + std::string flag = cmStrCat("-DCMAKE_OSX_ARCHITECTURES=", *tcArchs); arguments.CMakeFlags.emplace_back(std::move(flag)); cmakeVariables.emplace("CMAKE_OSX_ARCHITECTURES", *tcArchs); } + // Pass down CMAKE_EXPERIMENTAL_* feature flags + for (std::size_t i = 0; + i < static_cast<std::size_t>(cmExperimental::Feature::Sentinel); + i++) { + auto const& data = cmExperimental::DataForFeature( + static_cast<cmExperimental::Feature>(i)); + if (data.ForwardThroughTryCompile) { + vars.insert(data.Variable); + } + } + for (std::string const& var : vars) { if (cmValue val = this->Makefile->GetDefinition(var)) { - std::string flag = "-D" + var + "=" + *val; + std::string flag = cmStrCat("-D", var, '=', *val); arguments.CMakeFlags.emplace_back(std::move(flag)); cmakeVariables.emplace(var, *val); } @@ -1081,7 +1096,7 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode( // Forward the GHS variables to the inner project cache. for (std::string const& var : ghs_platform_vars) { if (cmValue val = this->Makefile->GetDefinition(var)) { - std::string flag = "-D" + var + "=" + "'" + *val + "'"; + std::string flag = cmStrCat("-D", var, "=\'", *val, '\''); arguments.CMakeFlags.emplace_back(std::move(flag)); cmakeVariables.emplace(var, *val); } @@ -1143,11 +1158,11 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode( } /* clang-format off */ err = cmStrCat( - "Cannot copy output executable\n", - " '", this->OutputFile, "'\n", - "to destination specified by COPY_FILE:\n", - " '", copyFile, "'\n", - "because:\n", + "Cannot copy output executable\n" + " '", this->OutputFile, "'\n" + "to destination specified by COPY_FILE:\n" + " '", copyFile, "'\n" + "because:\n" " ", err, "\n", this->FindErrorMessage); /* clang-format on */ @@ -1192,10 +1207,10 @@ void cmCoreTryCompile::CleanupFiles(std::string const& binDir) } if (!IsTemporary(binDir)) { - cmSystemTools::Error( + cmSystemTools::Error(cmStrCat( "TRY_COMPILE attempt to remove -rf directory that does not contain " - "CMakeTmp or CMakeScratch: \"" + - binDir + "\""); + "CMakeTmp or CMakeScratch: \"", + binDir, '"')); return; } @@ -1208,8 +1223,7 @@ void cmCoreTryCompile::CleanupFiles(std::string const& binDir) // Do not delete NFS temporary files. !cmHasPrefix(fileName, ".nfs")) { if (deletedFiles.insert(fileName).second) { - std::string const fullPath = - std::string(binDir).append("/").append(fileName); + std::string const fullPath = cmStrCat(binDir, '/', fileName); if (cmSystemTools::FileIsSymlink(fullPath)) { cmSystemTools::RemoveFile(fullPath); } else if (cmSystemTools::FileIsDirectory(fullPath)) { @@ -1293,12 +1307,12 @@ std::string cmCoreTryCompile::WriteSource(std::string const& filename, { if (!cmSystemTools::GetFilenamePath(filename).empty()) { const auto& msg = - cmStrCat(command, " given invalid filename \"", filename, "\""); + cmStrCat(command, " given invalid filename \"", filename, '"'); this->Makefile->IssueMessage(MessageType::FATAL_ERROR, msg); return {}; } - auto filepath = cmStrCat(this->BinaryDirectory, "/", filename); + auto filepath = cmStrCat(this->BinaryDirectory, '/', filename); cmsys::ofstream file{ filepath.c_str(), std::ios::out }; if (!file) { const auto& msg = @@ -1309,7 +1323,7 @@ std::string cmCoreTryCompile::WriteSource(std::string const& filename, file << content; if (!file) { - const auto& msg = cmStrCat(command, " failed to write \"", filename, "\""); + const auto& msg = cmStrCat(command, " failed to write \"", filename, '"'); this->Makefile->IssueMessage(MessageType::FATAL_ERROR, msg); return {}; } diff --git a/Source/cmCxxModuleMapper.cxx b/Source/cmCxxModuleMapper.cxx index e836a2a..e6c10c6 100644 --- a/Source/cmCxxModuleMapper.cxx +++ b/Source/cmCxxModuleMapper.cxx @@ -74,8 +74,62 @@ CxxBmiLocation CxxModuleLocations::BmiGeneratorPathForModule( namespace { +struct TransitiveUsage +{ + TransitiveUsage(std::string name, std::string location, LookupMethod method) + : LogicalName(std::move(name)) + , Location(std::move(location)) + , Method(method) + { + } + + std::string LogicalName; + std::string Location; + LookupMethod Method; +}; + +std::vector<TransitiveUsage> GetTransitiveUsages( + CxxModuleLocations const& loc, std::vector<cmSourceReqInfo> const& required, + CxxModuleUsage const& usages) +{ + std::set<std::string> transitive_usage_directs; + std::set<std::string> transitive_usage_names; + + std::vector<TransitiveUsage> all_usages; + + for (auto const& r : required) { + auto bmi_loc = loc.BmiGeneratorPathForModule(r.LogicalName); + if (bmi_loc.IsKnown()) { + all_usages.emplace_back(r.LogicalName, bmi_loc.Location(), r.Method); + transitive_usage_directs.insert(r.LogicalName); + + // Insert transitive usages. + auto transitive_usages = usages.Usage.find(r.LogicalName); + if (transitive_usages != usages.Usage.end()) { + transitive_usage_names.insert(transitive_usages->second.begin(), + transitive_usages->second.end()); + } + } + } + + for (auto const& transitive_name : transitive_usage_names) { + if (transitive_usage_directs.count(transitive_name)) { + continue; + } + + auto module_ref = usages.Reference.find(transitive_name); + if (module_ref != usages.Reference.end()) { + all_usages.emplace_back(transitive_name, module_ref->second.Path, + module_ref->second.Method); + } + } + + return all_usages; +} + std::string CxxModuleMapContentClang(CxxModuleLocations const& loc, - cmScanDepInfo const& obj) + cmScanDepInfo const& obj, + CxxModuleUsage const& usages) { std::stringstream mm; @@ -98,12 +152,11 @@ std::string CxxModuleMapContentClang(CxxModuleLocations const& loc, break; } } - for (auto const& r : obj.Requires) { - auto bmi_loc = loc.BmiGeneratorPathForModule(r.LogicalName); - if (bmi_loc.IsKnown()) { - mm << "-fmodule-file=" << r.LogicalName << "=" << bmi_loc.Location() - << '\n'; - } + + auto all_usages = GetTransitiveUsages(loc, obj.Requires, usages); + for (auto const& usage : all_usages) { + mm << "-fmodule-file=" << usage.LogicalName << '=' << usage.Location + << '\n'; } return mm.str(); @@ -122,7 +175,7 @@ std::string CxxModuleMapContentGcc(CxxModuleLocations const& loc, // generate any). // Write the root directory to use for module paths. - mm << "$root " << loc.RootDirectory << "\n"; + mm << "$root " << loc.RootDirectory << '\n'; for (auto const& p : obj.Provides) { auto bmi_loc = loc.BmiGeneratorPathForModule(p.LogicalName); @@ -180,37 +233,11 @@ std::string CxxModuleMapContentMsvc(CxxModuleLocations const& loc, } } - std::set<std::string> transitive_usage_directs; - std::set<std::string> transitive_usage_names; - - for (auto const& r : obj.Requires) { - auto bmi_loc = loc.BmiGeneratorPathForModule(r.LogicalName); - if (bmi_loc.IsKnown()) { - auto flag = flag_for_method(r.Method); - - mm << flag << ' ' << r.LogicalName << '=' << bmi_loc.Location() << "\n"; - transitive_usage_directs.insert(r.LogicalName); - - // Insert transitive usages. - auto transitive_usages = usages.Usage.find(r.LogicalName); - if (transitive_usages != usages.Usage.end()) { - transitive_usage_names.insert(transitive_usages->second.begin(), - transitive_usages->second.end()); - } - } - } - - for (auto const& transitive_name : transitive_usage_names) { - if (transitive_usage_directs.count(transitive_name)) { - continue; - } + auto all_usages = GetTransitiveUsages(loc, obj.Requires, usages); + for (auto const& usage : all_usages) { + auto flag = flag_for_method(usage.Method); - auto module_ref = usages.Reference.find(transitive_name); - if (module_ref != usages.Reference.end()) { - auto flag = flag_for_method(module_ref->second.Method); - mm << flag << ' ' << transitive_name << '=' << module_ref->second.Path - << "\n"; - } + mm << flag << ' ' << usage.LogicalName << '=' << usage.Location << '\n'; } return mm.str(); @@ -393,7 +420,7 @@ std::string CxxModuleMapContent(CxxModuleMapFormat format, { switch (format) { case CxxModuleMapFormat::Clang: - return CxxModuleMapContentClang(loc, obj); + return CxxModuleMapContentClang(loc, obj, usages); case CxxModuleMapFormat::Gcc: return CxxModuleMapContentGcc(loc, obj); case CxxModuleMapFormat::Msvc: diff --git a/Source/cmDebuggerVariablesHelper.cxx b/Source/cmDebuggerVariablesHelper.cxx index 1322b20..b2e85f2 100644 --- a/Source/cmDebuggerVariablesHelper.cxx +++ b/Source/cmDebuggerVariablesHelper.cxx @@ -10,7 +10,7 @@ #include <map> #include <sstream> -#include "cm_codecvt.hxx" +#include "cm_codecvt_Encoding.hxx" #include "cmDebuggerStackFrame.h" #include "cmDebuggerVariables.h" @@ -578,17 +578,17 @@ std::shared_ptr<cmDebuggerVariables> cmDebuggerVariablesHelper::CreateIfAny( return {}; } - auto makeFileEncodingString = [](codecvt::Encoding encoding) { + auto makeFileEncodingString = [](codecvt_Encoding encoding) { switch (encoding) { - case codecvt::Encoding::None: + case codecvt_Encoding::None: return "None"; - case codecvt::Encoding::UTF8: + case codecvt_Encoding::UTF8: return "UTF8"; - case codecvt::Encoding::UTF8_WITH_BOM: + case codecvt_Encoding::UTF8_WITH_BOM: return "UTF8_WITH_BOM"; - case codecvt::Encoding::ANSI: + case codecvt_Encoding::ANSI: return "ANSI"; - case codecvt::Encoding::ConsoleOutput: + case codecvt_Encoding::ConsoleOutput: return "ConsoleOutput"; default: return "Unknown"; diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx index 7fbd826..3b98219 100644 --- a/Source/cmExecuteProcessCommand.cxx +++ b/Source/cmExecuteProcessCommand.cxx @@ -20,6 +20,7 @@ #include "cmArgumentParser.h" #include "cmExecutionStatus.h" +#include "cmList.h" #include "cmMakefile.h" #include "cmMessageType.h" #include "cmProcessOutput.h" @@ -356,7 +357,7 @@ bool cmExecuteProcessCommand(std::vector<std::string> const& args, } } status.GetMakefile().AddDefinition(arguments.ResultsVariable, - cmJoin(res, ";")); + cmList::to_string(res)); } break; case cmsysProcess_State_Exception: status.GetMakefile().AddDefinition( diff --git a/Source/cmExperimental.cxx b/Source/cmExperimental.cxx index 2f26627..51c174e 100644 --- a/Source/cmExperimental.cxx +++ b/Source/cmExperimental.cxx @@ -18,36 +18,41 @@ namespace { * Search for other instances to keep the documentation and test suite * up-to-date. */ - -struct FeatureData -{ - std::string const Uuid; - std::string const Variable; - std::string const Description; - bool Warned; -} LookupTable[] = { +cmExperimental::FeatureData LookupTable[] = { // CxxModuleCMakeApi - { "aa1f7df0-828a-4fcd-9afc-2dc80491aca7", + { "CxxModuleCMakeApi", "bf70d4b0-9fb7-465c-9803-34014e70d112", "CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API", "CMake's C++ module support is experimental. It is meant only for " "experimentation and feedback to CMake developers.", + false, // https://gitlab.kitware.com/cmake/cmake/-/issues/25097 false }, + // WindowsKernelModeDriver + { "WindowsKernelModeDriver", "5c2d848d-4efa-4529-a768-efd57171bf68", + "CMAKE_EXPERIMENTAL_WINDOWS_KERNEL_MODE_DRIVER", + "CMake's Windows kernel-mode driver support is experimental. It is meant " + "only for experimentation and feedback to CMake developers.", + true, false }, }; static_assert(sizeof(LookupTable) / sizeof(LookupTable[0]) == static_cast<size_t>(cmExperimental::Feature::Sentinel), "Experimental feature lookup table mismatch"); -FeatureData& DataForFeature(cmExperimental::Feature f) +cmExperimental::FeatureData& DataForFeature(cmExperimental::Feature f) { assert(f != cmExperimental::Feature::Sentinel); return LookupTable[static_cast<size_t>(f)]; } } +const cmExperimental::FeatureData& cmExperimental::DataForFeature(Feature f) +{ + return ::DataForFeature(f); +} + bool cmExperimental::HasSupportEnabled(cmMakefile const& mf, Feature f) { bool enabled = false; - auto& data = DataForFeature(f); + auto& data = ::DataForFeature(f); auto value = mf.GetDefinition(data.Variable); if (value == data.Uuid) { diff --git a/Source/cmExperimental.h b/Source/cmExperimental.h index 26e0d17..3374ba8 100644 --- a/Source/cmExperimental.h +++ b/Source/cmExperimental.h @@ -5,6 +5,8 @@ #include "cmConfigure.h" // IWYU pragma: keep +#include <string> + class cmMakefile; class cmExperimental @@ -13,9 +15,21 @@ public: enum class Feature { CxxModuleCMakeApi, + WindowsKernelModeDriver, Sentinel, }; + struct FeatureData + { + std::string const Name; + std::string const Uuid; + std::string const Variable; + std::string const Description; + bool const ForwardThroughTryCompile; + bool Warned; + }; + + static const FeatureData& DataForFeature(Feature f); static bool HasSupportEnabled(cmMakefile const& mf, Feature f); }; diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx index df26bad..8d3960c 100644 --- a/Source/cmExportBuildFileGenerator.cxx +++ b/Source/cmExportBuildFileGenerator.cxx @@ -19,6 +19,7 @@ #include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" #include "cmGlobalGenerator.h" +#include "cmList.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmMessageType.h" @@ -237,7 +238,7 @@ void cmExportBuildFileGenerator::SetImportLocationProperty( } // Store the property. - properties[prop] = cmJoin(objects, ";"); + properties[prop] = cmList::to_string(objects); } else { // Add the main target file. { diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 22276ae..481c98f 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -383,7 +383,7 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface( cmGeneratorExpression ge(*target->Makefile->GetCMakeInstance()); std::string dirs = cmGeneratorExpression::Preprocess( - cmJoin(target->Target->GetInstallIncludeDirectoriesEntries(te), ";"), + cmList::to_string(target->Target->GetInstallIncludeDirectoriesEntries(te)), preprocessRule, true); this->ReplaceInstallPrefix(dirs); std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(dirs); @@ -955,13 +955,13 @@ void cmExportFileGenerator::GeneratePolicyHeaderCode(std::ostream& os) // Isolate the file policy level. // Support CMake versions as far back as 2.6 but also support using NEW - // policy settings for up to CMake 3.25 (this upper limit may be reviewed + // policy settings for up to CMake 3.26 (this upper limit may be reviewed // and increased from time to time). This reduces the opportunity for CMake // warnings when an older export file is later used with newer CMake // versions. /* clang-format off */ os << "cmake_policy(PUSH)\n" - << "cmake_policy(VERSION 2.8.3...3.25)\n"; + << "cmake_policy(VERSION 2.8.3...3.26)\n"; /* clang-format on */ } diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx index 538c883..264c947 100644 --- a/Source/cmExportInstallFileGenerator.cxx +++ b/Source/cmExportInstallFileGenerator.cxx @@ -19,6 +19,7 @@ #include "cmInstallExportGenerator.h" #include "cmInstallFileSetGenerator.h" #include "cmInstallTargetGenerator.h" +#include "cmList.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmMessageType.h" @@ -430,7 +431,7 @@ void cmExportInstallFileGenerator::SetImportLocationProperty( } // Store the property. - properties[prop] = cmJoin(objects, ";"); + properties[prop] = cmList::to_string(objects); importedLocations.insert(prop); } else { if (target->IsFrameworkOnApple() && target->HasImportLibrary(config)) { @@ -590,10 +591,12 @@ std::string cmExportInstallFileGenerator::GetFileSetDirectories( auto cge = ge.Parse(te->FileSetGenerators.at(fileSet)->GetDestination()); for (auto const& config : configs) { - auto dest = cmStrCat("${_IMPORT_PREFIX}/", - cmOutputConverter::EscapeForCMake( - cge->Evaluate(gte->LocalGenerator, config, gte), - cmOutputConverter::WrapQuotes::NoWrap)); + auto unescapedDest = cge->Evaluate(gte->LocalGenerator, config, gte); + auto dest = cmOutputConverter::EscapeForCMake( + unescapedDest, cmOutputConverter::WrapQuotes::NoWrap); + if (!cmSystemTools::FileIsFullPath(unescapedDest)) { + dest = cmStrCat("${_IMPORT_PREFIX}/", dest); + } auto const& type = fileSet->GetType(); // C++ modules do not support interface file sets which are dependent upon @@ -645,11 +648,14 @@ std::string cmExportInstallFileGenerator::GetFileSetFiles( fileSet->EvaluateFileEntry(directories, files, entry, gte->LocalGenerator, config, gte); } - auto dest = cmStrCat("${_IMPORT_PREFIX}/", - cmOutputConverter::EscapeForCMake( - destCge->Evaluate(gte->LocalGenerator, config, gte), - cmOutputConverter::WrapQuotes::NoWrap), - '/'); + auto unescapedDest = destCge->Evaluate(gte->LocalGenerator, config, gte); + auto dest = + cmStrCat(cmOutputConverter::EscapeForCMake( + unescapedDest, cmOutputConverter::WrapQuotes::NoWrap), + '/'); + if (!cmSystemTools::FileIsFullPath(unescapedDest)) { + dest = cmStrCat("${_IMPORT_PREFIX}/", dest); + } bool const contextSensitive = destCge->GetHadContextSensitiveCondition() || std::any_of(directoryEntries.begin(), directoryEntries.end(), diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx index f30c3c3..7e525d5 100644 --- a/Source/cmExportTryCompileFileGenerator.cxx +++ b/Source/cmExportTryCompileFileGenerator.cxx @@ -156,12 +156,12 @@ std::string cmExportTryCompileFileGenerator::GetFileSetDirectories( cmGeneratorTarget* /*gte*/, cmFileSet* fileSet, cmTargetExport* /*te*/) { return cmOutputConverter::EscapeForCMake( - cmJoin(fileSet->GetDirectoryEntries(), ";")); + cmList::to_string(fileSet->GetDirectoryEntries())); } std::string cmExportTryCompileFileGenerator::GetFileSetFiles( cmGeneratorTarget* /*gte*/, cmFileSet* fileSet, cmTargetExport* /*te*/) { return cmOutputConverter::EscapeForCMake( - cmJoin(fileSet->GetFileEntries(), ";")); + cmList::to_string(fileSet->GetFileEntries())); } diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 45fba8b..f4fbf75 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -30,6 +30,7 @@ #include "cmArgumentParser.h" #include "cmArgumentParserTypes.h" +#include "cmCMakePath.h" #include "cmCryptoHash.h" #include "cmELF.h" #include "cmExecutionStatus.h" @@ -42,6 +43,7 @@ #include "cmGeneratorExpression.h" #include "cmGlobalGenerator.h" #include "cmHexFileConverter.h" +#include "cmList.h" #include "cmListFileCache.h" #include "cmMakefile.h" #include "cmMessageType.h" @@ -805,7 +807,7 @@ bool HandleGlobImpl(std::vector<std::string> const& args, bool recurse, std::sort(files.begin(), files.end()); files.erase(std::unique(files.begin(), files.end()), files.end()); - status.GetMakefile().AddDefinition(variable, cmJoin(files, ";")); + status.GetMakefile().AddDefinition(variable, cmList::to_string(files)); return true; } @@ -1277,9 +1279,58 @@ bool HandleRealPathCommand(std::vector<std::string> const& args, } } - auto realPath = - cmSystemTools::CollapseFullPath(input, *arguments.BaseDirectory); - realPath = cmSystemTools::GetRealPath(realPath); + bool warnAbout152 = false; + bool use152New = true; + cmPolicies::PolicyStatus policyStatus = + status.GetMakefile().GetPolicyStatus(cmPolicies::CMP0152); + switch (policyStatus) { + case cmPolicies::REQUIRED_IF_USED: + case cmPolicies::REQUIRED_ALWAYS: + case cmPolicies::NEW: + break; + case cmPolicies::WARN: + use152New = false; + warnAbout152 = true; + break; + case cmPolicies::OLD: + use152New = false; + warnAbout152 = false; + break; + } + + auto computeNewPath = [=](std::string const& in, std::string& result) { + auto path = cmCMakePath{ in }; + if (path.IsRelative()) { + auto basePath = cmCMakePath{ *arguments.BaseDirectory }; + path = basePath.Append(path); + } + result = cmSystemTools::GetActualCaseForPath( + cmSystemTools::GetRealPath(path.String())); + }; + + std::string realPath; + if (use152New) { + computeNewPath(input, realPath); + } else { + std::string oldPolicyPath = + cmSystemTools::CollapseFullPath(input, *arguments.BaseDirectory); + oldPolicyPath = cmSystemTools::GetRealPath(oldPolicyPath); + if (warnAbout152) { + computeNewPath(input, realPath); + if (oldPolicyPath != realPath) { + status.GetMakefile().IssueMessage( + MessageType::AUTHOR_WARNING, + cmStrCat( + cmPolicies::GetPolicyWarning(cmPolicies::CMP0152), '\n', + "From input path:\n ", input, + "\nthe policy OLD behavior produces path:\n ", oldPolicyPath, + "\nbut the policy NEW behavior produces path:\n ", realPath, + "\nSince the policy is not set, CMake is using the OLD " + "behavior for compatibility.")); + } + } + realPath = oldPolicyPath; + } status.GetMakefile().AddDefinition(args[2], realPath); @@ -1556,7 +1607,7 @@ bool HandlePathCommand(std::vector<std::string> const& args, #endif std::vector<std::string> path = cmSystemTools::SplitString(args[1], pathSep); - std::string value = cmJoin(cmMakeRange(path).transform(convert), ";"); + std::string value = cmList::to_string(cmMakeRange(path).transform(convert)); status.GetMakefile().AddDefinition(args[2], value); return true; } @@ -3157,7 +3208,7 @@ bool HandleGetRuntimeDependenciesCommand(std::vector<std::string> const& args, if (!parsedArgs.RPathPrefix.empty()) { status.GetMakefile().AddDefinition( parsedArgs.RPathPrefix + "_" + firstPath, - cmJoin(archive.GetRPaths().at(firstPath), ";")); + cmList::to_string(archive.GetRPaths().at(firstPath))); } } else if (!parsedArgs.ConflictingDependenciesPrefix.empty()) { conflictingDeps.push_back(val.first); @@ -3165,7 +3216,7 @@ bool HandleGetRuntimeDependenciesCommand(std::vector<std::string> const& args, paths.insert(paths.begin(), val.second.begin(), val.second.end()); std::string varName = parsedArgs.ConflictingDependenciesPrefix + "_" + val.first; - std::string pathsStr = cmJoin(paths, ";"); + std::string pathsStr = cmList::to_string(paths); status.GetMakefile().AddDefinition(varName, pathsStr); } else { std::ostringstream e; @@ -3196,17 +3247,17 @@ bool HandleGetRuntimeDependenciesCommand(std::vector<std::string> const& args, } if (!parsedArgs.ResolvedDependenciesVar.empty()) { - std::string val = cmJoin(deps, ";"); + std::string val = cmList::to_string(deps); status.GetMakefile().AddDefinition(parsedArgs.ResolvedDependenciesVar, val); } if (!parsedArgs.UnresolvedDependenciesVar.empty()) { - std::string val = cmJoin(unresolvedDeps, ";"); + std::string val = cmList::to_string(unresolvedDeps); status.GetMakefile().AddDefinition(parsedArgs.UnresolvedDependenciesVar, val); } if (!parsedArgs.ConflictingDependenciesPrefix.empty()) { - std::string val = cmJoin(conflictingDeps, ";"); + std::string val = cmList::to_string(conflictingDeps); status.GetMakefile().AddDefinition( parsedArgs.ConflictingDependenciesPrefix + "_FILENAMES", val); } diff --git a/Source/cmFileLock.cxx b/Source/cmFileLock.cxx index 5d197d2..548e327 100644 --- a/Source/cmFileLock.cxx +++ b/Source/cmFileLock.cxx @@ -12,11 +12,7 @@ cmFileLock::cmFileLock(cmFileLock&& other) noexcept { this->File = other.File; -#if defined(_WIN32) - other.File = INVALID_HANDLE_VALUE; -#else - other.File = -1; -#endif + other.File = (decltype(other.File))-1; this->Filename = std::move(other.Filename); } @@ -32,11 +28,7 @@ cmFileLock::~cmFileLock() cmFileLock& cmFileLock::operator=(cmFileLock&& other) noexcept { this->File = other.File; -#if defined(_WIN32) - other.File = INVALID_HANDLE_VALUE; -#else - other.File = -1; -#endif + other.File = (decltype(other.File))-1; this->Filename = std::move(other.Filename); return *this; diff --git a/Source/cmFileLock.h b/Source/cmFileLock.h index 94baea1..0f2e7d9 100644 --- a/Source/cmFileLock.h +++ b/Source/cmFileLock.h @@ -7,7 +7,7 @@ #include <string> #if defined(_WIN32) -# include <windows.h> // HANDLE +using HANDLE = void*; #endif class cmFileLockResult; @@ -53,8 +53,8 @@ private: cmFileLockResult LockWithTimeout(unsigned long timeoutSec); #if defined(_WIN32) - HANDLE File = INVALID_HANDLE_VALUE; - BOOL LockFile(DWORD flags); + HANDLE File = (HANDLE)-1; + int LockFile(int flags); #else int File = -1; int LockFile(int cmd, int type) const; diff --git a/Source/cmFileLockResult.cxx b/Source/cmFileLockResult.cxx index b7f7f38..632c0e9 100644 --- a/Source/cmFileLockResult.cxx +++ b/Source/cmFileLockResult.cxx @@ -5,6 +5,10 @@ #include <cerrno> #include <cstring> +#ifdef _WIN32 +# include <Windows.h> +#endif + cmFileLockResult cmFileLockResult::MakeOk() { return { OK, 0 }; diff --git a/Source/cmFileLockResult.h b/Source/cmFileLockResult.h index 8a58d1f..e252de7 100644 --- a/Source/cmFileLockResult.h +++ b/Source/cmFileLockResult.h @@ -6,10 +6,6 @@ #include <string> -#if defined(_WIN32) -# include <windows.h> // DWORD -#endif - /** * @brief Result of the locking/unlocking file. * @note See @c cmFileLock @@ -17,11 +13,7 @@ class cmFileLockResult { public: -#if defined(_WIN32) - using Error = DWORD; -#else using Error = int; -#endif /** * @brief Successful lock/unlock. diff --git a/Source/cmFileLockWin32.cxx b/Source/cmFileLockWin32.cxx index 7bee5f2..244ade2 100644 --- a/Source/cmFileLockWin32.cxx +++ b/Source/cmFileLockWin32.cxx @@ -78,7 +78,7 @@ cmFileLockResult cmFileLock::LockWithTimeout(unsigned long seconds) } } -BOOL cmFileLock::LockFile(DWORD flags) +int cmFileLock::LockFile(int flags) { const DWORD reserved = 0; const unsigned long len = static_cast<unsigned long>(-1); diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx index 9eb0603..6a571b4 100644 --- a/Source/cmFindLibraryCommand.cxx +++ b/Source/cmFindLibraryCommand.cxx @@ -251,8 +251,14 @@ struct cmFindLibraryHelper void DebugLibraryFailed(std::string const& name, std::string const& path) { if (this->DebugMode) { - auto regexName = - cmStrCat(this->PrefixRegexStr, name, this->SuffixRegexStr); + // To improve readability of the debug output, if there is only one + // prefix/suffix, use the plain prefix/suffix instead of the regex. + const auto& prefix = (this->Prefixes.size() == 1) ? this->Prefixes[0] + : this->PrefixRegexStr; + const auto& suffix = (this->Suffixes.size() == 1) ? this->Suffixes[0] + : this->SuffixRegexStr; + + auto regexName = cmStrCat(prefix, name, suffix); this->DebugSearches.FailedAt(path, regexName); } } diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx index f4768b6..8d2d972 100644 --- a/Source/cmFunctionCommand.cxx +++ b/Source/cmFunctionCommand.cxx @@ -11,6 +11,7 @@ #include "cmExecutionStatus.h" #include "cmFunctionBlocker.h" +#include "cmList.h" #include "cmListFileCache.h" #include "cmMakefile.h" #include "cmPolicies.h" @@ -89,9 +90,9 @@ bool cmFunctionHelperCommand::operator()( } // define ARGV and ARGN - auto const argvDef = cmJoin(expandedArgs, ";"); + auto const argvDef = cmList::to_string(expandedArgs); auto const eit = expandedArgs.begin() + (this->Args.size() - 1); - auto const argnDef = cmJoin(cmMakeRange(eit, expandedArgs.end()), ";"); + auto const argnDef = cmList::to_string(cmMakeRange(eit, expandedArgs.end())); makefile.AddDefinition(ARGV, argvDef); makefile.MarkVariableAsUsed(ARGV); makefile.AddDefinition(ARGN, argnDef); diff --git a/Source/cmGeneratedFileStream.cxx b/Source/cmGeneratedFileStream.cxx index 133bf5f..e669f68 100644 --- a/Source/cmGeneratedFileStream.cxx +++ b/Source/cmGeneratedFileStream.cxx @@ -16,7 +16,7 @@ cmGeneratedFileStream::cmGeneratedFileStream(Encoding encoding) { #ifndef CMAKE_BOOTSTRAP - if (encoding != codecvt::None) { + if (encoding != codecvt_Encoding::None) { this->imbue(std::locale(this->getloc(), new codecvt(encoding))); } #else @@ -35,13 +35,13 @@ cmGeneratedFileStream::cmGeneratedFileStream(std::string const& name, cmSystemTools::ReportLastSystemError(""); } #ifndef CMAKE_BOOTSTRAP - if (encoding != codecvt::None) { + if (encoding != codecvt_Encoding::None) { this->imbue(std::locale(this->getloc(), new codecvt(encoding))); } #else static_cast<void>(encoding); #endif - if (encoding == codecvt::UTF8_WITH_BOM) { + if (encoding == codecvt_Encoding::UTF8_WITH_BOM) { // Write the BOM encoding header into the file char magic[] = { static_cast<char>(0xEF), static_cast<char>(0xBB), static_cast<char>(0xBF) }; diff --git a/Source/cmGeneratedFileStream.h b/Source/cmGeneratedFileStream.h index bfc121f..a26616d 100644 --- a/Source/cmGeneratedFileStream.h +++ b/Source/cmGeneratedFileStream.h @@ -8,7 +8,7 @@ #include "cmsys/FStream.hxx" -#include "cm_codecvt.hxx" +#include "cm_codecvt_Encoding.hxx" // This is the first base class of cmGeneratedFileStream. It will be // created before and destroyed after the ofstream portion and can @@ -77,13 +77,13 @@ class cmGeneratedFileStream { public: using Stream = cmsys::ofstream; - using Encoding = codecvt::Encoding; + using Encoding = codecvt_Encoding; /** * This constructor prepares a default stream. The open method must * be used before writing to the stream. */ - cmGeneratedFileStream(Encoding encoding = codecvt::None); + cmGeneratedFileStream(codecvt_Encoding encoding = codecvt_Encoding::None); /** * This constructor takes the name of the file to be generated. It @@ -92,7 +92,7 @@ public: * second argument is set to true. */ cmGeneratedFileStream(std::string const& name, bool quiet = false, - Encoding encoding = codecvt::None); + codecvt_Encoding encoding = codecvt_Encoding::None); /** * The destructor checks the stream status to be sure the temporary @@ -151,5 +151,5 @@ public: * Write a specific string using an alternate encoding. * Afterward, the original encoding is restored. */ - void WriteAltEncoding(std::string const& data, Encoding encoding); + void WriteAltEncoding(std::string const& data, codecvt_Encoding encoding); }; diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index 7fe814a..30798a3 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -2540,7 +2540,7 @@ static const struct LinkLibraryNode : public cmGeneratorExpressionNode list.front() = LL_BEGIN; list.push_back(LL_END); - return cmJoin(list, ";"_s); + return list.to_string(); } } linkLibraryNode; @@ -2609,7 +2609,7 @@ static const struct LinkGroupNode : public cmGeneratorExpressionNode list.front() = LG_BEGIN; list.push_back(LG_END); - return cmJoin(list, ";"_s); + return list.to_string(); } } linkGroupNode; @@ -2634,7 +2634,7 @@ static const struct HostLinkNode : public cmGeneratorExpressionNode } return context->HeadTarget->IsDeviceLink() ? std::string() - : cmJoin(parameters, ";"); + : cmList::to_string(parameters); } } hostLinkNode; @@ -2669,7 +2669,7 @@ static const struct DeviceLinkNode : public cmGeneratorExpressionNode list.insert(list.begin(), static_cast<std::string>(DL_BEGIN)); list.push_back(static_cast<std::string>(DL_END)); - return cmJoin(list, ";"); + return list.to_string(); } return std::string(); @@ -3106,7 +3106,7 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode mf->AddTargetObject(tgtName, o); } - return cmJoin(objects, ";"); + return objects.to_string(); } } targetObjectsNode; @@ -3166,7 +3166,7 @@ static const struct TargetRuntimeDllsNode : public TargetRuntimeDllsBaseNode cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override { std::vector<std::string> dlls = CollectDlls(parameters, context, content); - return cmJoin(dlls, ";"); + return cmList::to_string(dlls); } } targetRuntimeDllsNode; @@ -3189,7 +3189,7 @@ static const struct TargetRuntimeDllDirsNode : public TargetRuntimeDllsBaseNode dllDirs.push_back(directory); } } - return cmJoin(dllDirs, ";"); + return cmList::to_string(dllDirs); } } targetRuntimeDllDirsNode; diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 357d0a6..42be082 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -190,7 +190,7 @@ public: } static std::string filesStr; - filesStr = cmJoin(files, ";"); + filesStr = cmList::to_string(files); return filesStr; } @@ -322,8 +322,7 @@ cmValue cmGeneratorTarget::GetSourcesProperty() const values.push_back(se->GetInput()); } static std::string value; - value.clear(); - value = cmJoin(values, ";"); + value = cmList::to_string(values); return cmValue(value); } @@ -1493,9 +1492,9 @@ std::string AddLangSpecificInterfaceIncludeDirectories( } std::string directories; - if (const auto* interface = target->GetLinkInterfaceLibraries( + if (const auto* link_interface = target->GetLinkInterfaceLibraries( config, root, LinkInterfaceFor::Usage)) { - for (const cmLinkItem& library : interface->Libraries) { + for (const cmLinkItem& library : link_interface->Libraries) { if (const cmGeneratorTarget* dependency = library.Target) { if (cm::contains(dependency->GetAllConfigCompileLanguages(), lang)) { auto* lg = dependency->GetLocalGenerator(); @@ -3828,7 +3827,8 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetIncludeDirectories( if (lib.Target == nullptr) { libDir = cmSystemTools::CollapseFullPath( lib.AsStr(), this->Makefile->GetHomeOutputDirectory()); - } else if (lib.Target->Target->IsFrameworkOnApple()) { + } else if (lib.Target->Target->IsFrameworkOnApple() || + this->IsImportedFrameworkFolderOnApple(config)) { libDir = lib.Target->GetLocation(config); } else { continue; @@ -8572,6 +8572,16 @@ bool cmGeneratorTarget::IsFrameworkOnApple() const return this->Target->IsFrameworkOnApple(); } +bool cmGeneratorTarget::IsImportedFrameworkFolderOnApple( + const std::string& config) const +{ + return this->IsApple() && this->IsImported() && + (this->GetType() == cmStateEnums::STATIC_LIBRARY || + this->GetType() == cmStateEnums::SHARED_LIBRARY || + this->GetType() == cmStateEnums::UNKNOWN_LIBRARY) && + cmSystemTools::IsPathToFramework(this->GetLocation(config)); +} + bool cmGeneratorTarget::IsAppBundleOnApple() const { return this->Target->IsAppBundleOnApple(); diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 78945c3..a03513d 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -812,6 +812,10 @@ public: Apple. */ bool IsFrameworkOnApple() const; + /** Return whether this target is an IMPORTED library target on Apple + with a .framework folder as its location. */ + bool IsImportedFrameworkFolderOnApple(const std::string& config) const; + /** Return whether this target is an executable Bundle on Apple. */ bool IsAppBundleOnApple() const; @@ -1072,6 +1076,7 @@ private: std::string SharedDeps; }; + friend cmComputeLinkInformation; using ImportInfoMapType = std::map<std::string, ImportInfo>; mutable ImportInfoMapType ImportInfoMap; void ComputeImportInfo(std::string const& desired_config, diff --git a/Source/cmGetCMakePropertyCommand.cxx b/Source/cmGetCMakePropertyCommand.cxx index 42bd206..d2c4fd6 100644 --- a/Source/cmGetCMakePropertyCommand.cxx +++ b/Source/cmGetCMakePropertyCommand.cxx @@ -6,9 +6,9 @@ #include "cmExecutionStatus.h" #include "cmGlobalGenerator.h" +#include "cmList.h" #include "cmMakefile.h" #include "cmState.h" -#include "cmStringAlgorithms.h" #include "cmValue.h" // cmGetCMakePropertyCommand @@ -35,7 +35,7 @@ bool cmGetCMakePropertyCommand(std::vector<std::string> const& args, } else if (args[1] == "COMPONENTS") { const std::set<std::string>* components = status.GetMakefile().GetGlobalGenerator()->GetInstallComponents(); - output = cmJoin(*components, ";"); + output = cmList::to_string(*components); } else { cmValue prop = nullptr; if (!args[1].empty()) { diff --git a/Source/cmGlobalBorlandMakefileGenerator.h b/Source/cmGlobalBorlandMakefileGenerator.h index 049d6ba..a2adbd0 100644 --- a/Source/cmGlobalBorlandMakefileGenerator.h +++ b/Source/cmGlobalBorlandMakefileGenerator.h @@ -54,6 +54,8 @@ public: bool AllowDeleteOnError() const override { return false; } bool CanEscapeOctothorpe() const override { return true; } + bool IsGNUMakeJobServerAware() const override { return false; } + protected: std::vector<GeneratedMakeCommand> GenerateBuildCommand( const std::string& makeProgram, const std::string& projectName, diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 5175aae..2ee56f1 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -24,10 +24,6 @@ #include "cmsys/FStream.hxx" #include "cmsys/RegularExpression.hxx" -#if defined(_WIN32) && !defined(__CYGWIN__) -# include <windows.h> -#endif - #include "cmAlgorithms.h" #include "cmCPackPropertiesGenerator.h" #include "cmComputeTargetDepends.h" @@ -142,6 +138,10 @@ cmGlobalGenerator::~cmGlobalGenerator() { this->ClearGeneratorMembers(); } +codecvt_Encoding cmGlobalGenerator::GetMakefileEncoding() const +{ + return codecvt_Encoding::None; +} #if !defined(CMAKE_BOOTSTRAP) Json::Value cmGlobalGenerator::GetJson() const @@ -239,7 +239,8 @@ void cmGlobalGenerator::ResolveLanguageCompiler(const std::string& lang, if (!mf->GetDefinition(langComp)) { if (!optional) { - cmSystemTools::Error(langComp + " not set, after EnableLanguage"); + cmSystemTools::Error( + cmStrCat(langComp, " not set, after EnableLanguage")); } return; } @@ -636,11 +637,10 @@ void cmGlobalGenerator::EnableLanguage( #if defined(_WIN32) && !defined(__CYGWIN__) cmSystemTools::WindowsVersion windowsVersion = cmSystemTools::GetWindowsVersion(); - std::ostringstream windowsVersionString; - windowsVersionString << windowsVersion.dwMajorVersion << "." - << windowsVersion.dwMinorVersion << "." - << windowsVersion.dwBuildNumber; - mf->AddDefinition("CMAKE_HOST_SYSTEM_VERSION", windowsVersionString.str()); + auto windowsVersionString = cmStrCat(windowsVersion.dwMajorVersion, '.', + windowsVersion.dwMinorVersion, '.', + windowsVersion.dwBuildNumber); + mf->AddDefinition("CMAKE_HOST_SYSTEM_VERSION", windowsVersionString); #endif // Read the DetermineSystem file std::string systemFile = mf->GetModulesFile("CMakeDetermineSystem.cmake"); @@ -695,22 +695,22 @@ void cmGlobalGenerator::EnableLanguage( setupFile, mf->GetCurrentSourceDirectory()); if (!cmSystemTools::FileExists(absSetupFile)) { cmSystemTools::Error( - "CMAKE_PROJECT_TOP_LEVEL_INCLUDES file does not exist: " + - setupFile); + cmStrCat("CMAKE_PROJECT_TOP_LEVEL_INCLUDES file does not exist: ", + setupFile)); mf->GetState()->SetInTopLevelIncludes(false); return; } if (cmSystemTools::FileIsDirectory(absSetupFile)) { cmSystemTools::Error( - "CMAKE_PROJECT_TOP_LEVEL_INCLUDES file is a directory: " + - setupFile); + cmStrCat("CMAKE_PROJECT_TOP_LEVEL_INCLUDES file is a directory: ", + setupFile)); mf->GetState()->SetInTopLevelIncludes(false); return; } if (!mf->ReadListFile(absSetupFile)) { cmSystemTools::Error( - "Failed reading CMAKE_PROJECT_TOP_LEVEL_INCLUDES file: " + - setupFile); + cmStrCat("Failed reading CMAKE_PROJECT_TOP_LEVEL_INCLUDES file: ", + setupFile)); mf->GetState()->SetInTopLevelIncludes(false); return; } @@ -754,7 +754,8 @@ void cmGlobalGenerator::EnableLanguage( // to avoid duplicate compiler tests. if (cmSystemTools::FileExists(fpath)) { if (!mf->ReadListFile(fpath)) { - cmSystemTools::Error("Could not find cmake module file: " + fpath); + cmSystemTools::Error( + cmStrCat("Could not find cmake module file: ", fpath)); } // if this file was found then the language was already determined // to be working @@ -778,8 +779,8 @@ void cmGlobalGenerator::EnableLanguage( cmStrCat("CMakeDetermine", lang, "Compiler.cmake"); std::string determineFile = mf->GetModulesFile(determineCompiler); if (!mf->ReadListFile(determineFile)) { - cmSystemTools::Error("Could not find cmake module file: " + - determineCompiler); + cmSystemTools::Error( + cmStrCat("Could not find cmake module file: ", determineCompiler)); } if (cmSystemTools::GetFatalErrorOccurred()) { return; @@ -807,7 +808,8 @@ void cmGlobalGenerator::EnableLanguage( // configures CMake(LANG)Compiler.cmake fpath = cmStrCat(rootBin, "/CMake", lang, "Compiler.cmake"); if (!mf->ReadListFile(fpath)) { - cmSystemTools::Error("Could not find cmake module file: " + fpath); + cmSystemTools::Error( + cmStrCat("Could not find cmake module file: ", fpath)); } this->SetLanguageEnabledFlag(lang, mf); needSetLanguageEnabledMaps[lang] = true; @@ -890,10 +892,11 @@ void cmGlobalGenerator::EnableLanguage( fpath = cmStrCat("CMake", lang, "Information.cmake"); std::string informationFile = mf->GetModulesFile(fpath); if (informationFile.empty()) { - cmSystemTools::Error("Could not find cmake module file: " + fpath); + cmSystemTools::Error( + cmStrCat("Could not find cmake module file: ", fpath)); } else if (!mf->ReadListFile(informationFile)) { - cmSystemTools::Error("Could not process cmake module file: " + - informationFile); + cmSystemTools::Error( + cmStrCat("Could not process cmake module file: ", informationFile)); } } if (needSetLanguageEnabledMaps[lang]) { @@ -911,8 +914,8 @@ void cmGlobalGenerator::EnableLanguage( std::string testLang = cmStrCat("CMakeTest", lang, "Compiler.cmake"); std::string ifpath = mf->GetModulesFile(testLang); if (!mf->ReadListFile(ifpath)) { - cmSystemTools::Error("Could not find cmake module file: " + - testLang); + cmSystemTools::Error( + cmStrCat("Could not find cmake module file: ", testLang)); } std::string compilerWorks = cmStrCat("CMAKE_", lang, "_COMPILER_WORKS"); @@ -977,7 +980,7 @@ void cmGlobalGenerator::PrintCompilerAdvice(std::ostream& os, void cmGlobalGenerator::CheckCompilerIdCompatibility( cmMakefile* mf, std::string const& lang) const { - std::string compilerIdVar = "CMAKE_" + lang + "_COMPILER_ID"; + std::string compilerIdVar = cmStrCat("CMAKE_", lang, "_COMPILER_ID"); std::string const compilerId = mf->GetSafeDefinition(compilerIdVar); if (compilerId == "AppleClang") { @@ -1105,9 +1108,9 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility( } { // Fix compiler versions. - std::string version = "CMAKE_" + lang + "_COMPILER_VERSION"; - std::string emulated = "CMAKE_" + lang + "_SIMULATE_VERSION"; - std::string emulatedId = "CMAKE_" + lang + "_SIMULATE_ID"; + std::string version = cmStrCat("CMAKE_", lang, "_COMPILER_VERSION"); + std::string emulated = cmStrCat("CMAKE_", lang, "_SIMULATE_VERSION"); + std::string emulatedId = cmStrCat("CMAKE_", lang, "_SIMULATE_ID"); std::string const& actual = mf->GetRequiredDefinition(emulated); mf->AddDefinition(version, actual); mf->RemoveDefinition(emulatedId); @@ -1208,7 +1211,7 @@ void cmGlobalGenerator::SetLanguageEnabledMaps(const std::string& l, return; } - std::string linkerPrefVar = "CMAKE_" + l + "_LINKER_PREFERENCE"; + std::string linkerPrefVar = cmStrCat("CMAKE_", l, "_LINKER_PREFERENCE"); cmValue linkerPref = mf->GetDefinition(linkerPrefVar); int preference = 0; if (cmNonempty(linkerPref)) { @@ -1234,7 +1237,7 @@ void cmGlobalGenerator::SetLanguageEnabledMaps(const std::string& l, this->LanguageToLinkerPreference[l] = preference; - std::string outputExtensionVar = "CMAKE_" + l + "_OUTPUT_EXTENSION"; + std::string outputExtensionVar = cmStrCat("CMAKE_", l, "_OUTPUT_EXTENSION"); if (cmValue p = mf->GetDefinition(outputExtensionVar)) { std::string outputExtension = *p; this->LanguageToOutputExtension[l] = outputExtension; @@ -1251,7 +1254,7 @@ void cmGlobalGenerator::SetLanguageEnabledMaps(const std::string& l, this->FillExtensionToLanguageMap(l, mf); std::string ignoreExtensionsVar = - std::string("CMAKE_") + std::string(l) + std::string("_IGNORE_EXTENSIONS"); + cmStrCat("CMAKE_", l, "_IGNORE_EXTENSIONS"); std::string ignoreExts = mf->GetSafeDefinition(ignoreExtensionsVar); cmList extensionList{ ignoreExts }; for (std::string const& i : extensionList) { @@ -1262,8 +1265,7 @@ void cmGlobalGenerator::SetLanguageEnabledMaps(const std::string& l, void cmGlobalGenerator::FillExtensionToLanguageMap(const std::string& l, cmMakefile* mf) { - std::string extensionsVar = std::string("CMAKE_") + std::string(l) + - std::string("_SOURCE_FILE_EXTENSIONS"); + std::string extensionsVar = cmStrCat("CMAKE_", l, "_SOURCE_FILE_EXTENSIONS"); const std::string& exts = mf->GetSafeDefinition(extensionsVar); cmList extensionList{ exts }; for (std::string const& i : extensionList) { @@ -1886,7 +1888,7 @@ void cmGlobalGenerator::FinalizeTargetConfiguration() std::set<std::string> standardIncludesSet; for (std::string const& li : langs) { std::string const standardIncludesVar = - "CMAKE_" + li + "_STANDARD_INCLUDE_DIRECTORIES"; + cmStrCat("CMAKE_", li, "_STANDARD_INCLUDE_DIRECTORIES"); std::string const& standardIncludesStr = mf->GetSafeDefinition(standardIncludesVar); cmList standardIncludesList{ standardIncludesStr }; @@ -2017,13 +2019,14 @@ void cmGlobalGenerator::CheckTargetProperties() for (auto const& notFound : notFoundMap) { notFoundVars += notFound.first; notFoundVars += notFound.second; - notFoundVars += "\n"; + notFoundVars += '\n'; } - cmSystemTools::Error("The following variables are used in this project, " - "but they are set to NOTFOUND.\n" - "Please set them or make sure they are set and " - "tested correctly in the CMake files:\n" + - notFoundVars); + cmSystemTools::Error( + cmStrCat("The following variables are used in this project, " + "but they are set to NOTFOUND.\n" + "Please set them or make sure they are set and " + "tested correctly in the CMake files:\n", + notFoundVars)); } } @@ -2181,8 +2184,8 @@ int cmGlobalGenerator::Build( outputflag, timeout)) { cmSystemTools::SetRunCommandHideConsole(hideconsole); cmSystemTools::Error( - "Generator: execution of make failed. Make command was: " + - makeCommandStr); + cmStrCat("Generator: execution of make failed. Make command was: ", + makeCommandStr)); ostr << *outputPtr << "\nGenerator: execution of make failed. Make command was: " << outputMakeCommandStr << std::endl; @@ -3342,7 +3345,7 @@ void cmGlobalGenerator::WriteSummary(cmGeneratorTarget* target) // Place the labels file in a per-target support directory. std::string dir = target->GetSupportDirectory(); std::string file = cmStrCat(dir, "/Labels.txt"); - std::string json_file = dir + "/Labels.json"; + std::string json_file = cmStrCat(dir, "/Labels.json"); #ifndef CMAKE_BOOTSTRAP // Check whether labels are enabled for this target. diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 9aefaff..0815e31 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -19,7 +19,7 @@ #include <cmext/algorithm> #include <cmext/string_view> -#include "cm_codecvt.hxx" +#include "cm_codecvt_Encoding.hxx" #include "cmBuildOptions.h" #include "cmCustomCommandLines.h" @@ -120,10 +120,7 @@ public: } /** Get encoding used by generator for makefile files */ - virtual codecvt::Encoding GetMakefileEncoding() const - { - return codecvt::None; - } + virtual codecvt_Encoding GetMakefileEncoding() const; #if !defined(CMAKE_BOOTSTRAP) /** Get a JSON object describing the generator. */ @@ -161,6 +158,8 @@ public: virtual bool CheckCxxModuleSupport() { return false; } + virtual bool IsGNUMakeJobServerAware() const { return false; } + bool Compute(); virtual void AddExtraIDETargets() {} @@ -640,6 +639,8 @@ public: }; StripCommandStyle GetStripCommandStyle(std::string const& strip); + virtual std::string& EncodeLiteral(std::string& lit) { return lit; } + protected: // for a project collect all its targets by following depend // information, and also collect all the targets diff --git a/Source/cmGlobalJOMMakefileGenerator.h b/Source/cmGlobalJOMMakefileGenerator.h index 5e74875..cd3ed33 100644 --- a/Source/cmGlobalJOMMakefileGenerator.h +++ b/Source/cmGlobalJOMMakefileGenerator.h @@ -47,6 +47,8 @@ public: void EnableLanguage(std::vector<std::string> const& languages, cmMakefile*, bool optional) override; + bool IsGNUMakeJobServerAware() const override { return false; } + protected: std::vector<GeneratedMakeCommand> GenerateBuildCommand( const std::string& makeProgram, const std::string& projectName, diff --git a/Source/cmGlobalNMakeMakefileGenerator.h b/Source/cmGlobalNMakeMakefileGenerator.h index 436ebca..eafab83 100644 --- a/Source/cmGlobalNMakeMakefileGenerator.h +++ b/Source/cmGlobalNMakeMakefileGenerator.h @@ -7,7 +7,7 @@ #include <string> #include <vector> -#include "cm_codecvt.hxx" +#include "cm_codecvt_Encoding.hxx" #include "cmGlobalGeneratorFactory.h" #include "cmGlobalUnixMakefileGenerator3.h" @@ -38,9 +38,10 @@ public: static std::string GetActualName() { return "NMake Makefiles"; } /** Get encoding used by generator for makefile files */ - codecvt::Encoding GetMakefileEncoding() const override + codecvt_Encoding GetMakefileEncoding() const override { - return this->NMakeSupportsUTF8 ? codecvt::UTF8_WITH_BOM : codecvt::ANSI; + return this->NMakeSupportsUTF8 ? codecvt_Encoding::UTF8_WITH_BOM + : codecvt_Encoding::ANSI; } /** Get the documentation entry for this generator. */ @@ -53,6 +54,8 @@ public: void EnableLanguage(std::vector<std::string> const& languages, cmMakefile*, bool optional) override; + bool IsGNUMakeJobServerAware() const override { return false; } + protected: std::vector<GeneratedMakeCommand> GenerateBuildCommand( const std::string& makeProgram, const std::string& projectName, diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 97c9b70..71084cc 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -181,14 +181,13 @@ std::string cmGlobalNinjaGenerator::EncodeRuleName(std::string const& name) return encoded; } -std::string cmGlobalNinjaGenerator::EncodeLiteral(const std::string& lit) +std::string cmGlobalNinjaGenerator::GetEncodedLiteral(const std::string& lit) { std::string result = lit; - EncodeLiteralInplace(result); - return result; + return this->EncodeLiteral(result); } -void cmGlobalNinjaGenerator::EncodeLiteralInplace(std::string& lit) +std::string& cmGlobalNinjaGenerator::EncodeLiteral(std::string& lit) { cmSystemTools::ReplaceString(lit, "$", "$$"); cmSystemTools::ReplaceString(lit, "\n", "$\n"); @@ -196,6 +195,7 @@ void cmGlobalNinjaGenerator::EncodeLiteralInplace(std::string& lit) cmSystemTools::ReplaceString(lit, cmStrCat('$', this->GetCMakeCFGIntDir()), this->GetCMakeCFGIntDir()); } + return lit; } std::string cmGlobalNinjaGenerator::EncodePath(const std::string& path) @@ -207,7 +207,7 @@ std::string cmGlobalNinjaGenerator::EncodePath(const std::string& path) else std::replace(result.begin(), result.end(), '/', '\\'); #endif - this->EncodeLiteralInplace(result); + this->EncodeLiteral(result); cmSystemTools::ReplaceString(result, " ", "$ "); cmSystemTools::ReplaceString(result, ":", "$:"); return result; @@ -394,7 +394,7 @@ void cmGlobalNinjaGenerator::WriteCustomCommandBuild( #endif vars["COMMAND"] = std::move(cmd); } - vars["DESC"] = this->EncodeLiteral(description); + vars["DESC"] = this->GetEncodedLiteral(description); if (restat) { vars["restat"] = "1"; } @@ -566,7 +566,7 @@ std::unique_ptr<cmLocalGenerator> cmGlobalNinjaGenerator::CreateLocalGenerator( cm::make_unique<cmLocalNinjaGenerator>(this, mf)); } -codecvt::Encoding cmGlobalNinjaGenerator::GetMakefileEncoding() const +codecvt_Encoding cmGlobalNinjaGenerator::GetMakefileEncoding() const { return this->NinjaExpectedEncoding; } @@ -799,7 +799,7 @@ void cmGlobalNinjaGenerator::CheckNinjaFeatures() if (this->NinjaSupportsCodePage) { this->CheckNinjaCodePage(); } else { - this->NinjaExpectedEncoding = codecvt::ANSI; + this->NinjaExpectedEncoding = codecvt_Encoding::ANSI; } #endif } @@ -830,9 +830,9 @@ void cmGlobalNinjaGenerator::CheckNinjaCodePage() lineView.substr(cmStrLen("Build file encoding: ")); if (encoding == "UTF-8") { // Ninja expects UTF-8. We use that internally. No conversion needed. - this->NinjaExpectedEncoding = codecvt::None; + this->NinjaExpectedEncoding = codecvt_Encoding::None; } else { - this->NinjaExpectedEncoding = codecvt::ANSI; + this->NinjaExpectedEncoding = codecvt_Encoding::ANSI; } found = true; break; @@ -842,10 +842,10 @@ void cmGlobalNinjaGenerator::CheckNinjaCodePage() this->GetCMakeInstance()->IssueMessage( MessageType::WARNING, "Could not determine Ninja's code page, defaulting to UTF-8"); - this->NinjaExpectedEncoding = codecvt::None; + this->NinjaExpectedEncoding = codecvt_Encoding::None; } } else { - this->NinjaExpectedEncoding = codecvt::ANSI; + this->NinjaExpectedEncoding = codecvt_Encoding::ANSI; } } diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index bfbe57f..4b026eb 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -16,7 +16,7 @@ #include <cm/optional> -#include "cm_codecvt.hxx" +#include "cm_codecvt_Encoding.hxx" #include "cmBuildOptions.h" #include "cmGeneratedFileStream.h" @@ -77,8 +77,8 @@ public: static void WriteDivider(std::ostream& os); static std::string EncodeRuleName(std::string const& name); - std::string EncodeLiteral(const std::string& lit); - void EncodeLiteralInplace(std::string& lit); + std::string& EncodeLiteral(std::string& lit) override; + std::string GetEncodedLiteral(const std::string& lit); std::string EncodePath(const std::string& path); std::unique_ptr<cmLinkLineComputer> CreateLinkLineComputer( @@ -192,7 +192,7 @@ public: bool IsNinja() const override { return true; } /** Get encoding used by generator for ninja files */ - codecvt::Encoding GetMakefileEncoding() const override; + codecvt_Encoding GetMakefileEncoding() const override; static cmDocumentationEntry GetDocumentation(); @@ -590,7 +590,7 @@ private: bool NinjaSupportsMetadataOnRegeneration = false; bool NinjaSupportsCodePage = false; - codecvt::Encoding NinjaExpectedEncoding = codecvt::None; + codecvt_Encoding NinjaExpectedEncoding = codecvt_Encoding::None; bool DiagnosedCxxModuleNinjaSupport = false; diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h index 760679a..ee78351 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.h +++ b/Source/cmGlobalUnixMakefileGenerator3.h @@ -120,6 +120,8 @@ public: void Configure() override; + bool IsGNUMakeJobServerAware() const override { return true; } + /** * Generate the all required files for building this project/tree. This * basically creates a series of LocalGenerators for each directory and diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 321f377..f1d04e5 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -1230,7 +1230,6 @@ const char* cmGlobalVisualStudio10Generator::GetToolsVersion() const { switch (this->Version) { case cmGlobalVisualStudioGenerator::VSVersion::VS9: - case cmGlobalVisualStudioGenerator::VSVersion::VS11: return "4.0"; // in Visual Studio 2013 they detached the MSBuild tools version diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx index 3ad10eb..c4e1e11 100644 --- a/Source/cmGlobalVisualStudio11Generator.cxx +++ b/Source/cmGlobalVisualStudio11Generator.cxx @@ -8,156 +8,17 @@ #include <vector> #include "cmGlobalGenerator.h" -#include "cmGlobalGeneratorFactory.h" #include "cmGlobalVisualStudioGenerator.h" #include "cmMakefile.h" #include "cmMessageType.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" -static const char vs11generatorName[] = "Visual Studio 11 2012"; - -// Map generator name without year to name with year. -static const char* cmVS11GenName(const std::string& name, std::string& genName) -{ - if (strncmp(name.c_str(), vs11generatorName, - sizeof(vs11generatorName) - 6) != 0) { - return nullptr; - } - const char* p = name.c_str() + sizeof(vs11generatorName) - 6; - if (cmHasLiteralPrefix(p, " 2012")) { - p += 5; - } - genName = std::string(vs11generatorName) + p; - return p; -} - -class cmGlobalVisualStudio11Generator::Factory - : public cmGlobalGeneratorFactory -{ -public: - std::unique_ptr<cmGlobalGenerator> CreateGlobalGenerator( - const std::string& name, bool allowArch, cmake* cm) const override - { - std::string genName; - const char* p = cmVS11GenName(name, genName); - if (!p) { - return std::unique_ptr<cmGlobalGenerator>(); - } - if (!*p) { - return std::unique_ptr<cmGlobalGenerator>( - new cmGlobalVisualStudio11Generator(cm, genName, "")); - } - if (!allowArch || *p++ != ' ') { - return std::unique_ptr<cmGlobalGenerator>(); - } - if (strcmp(p, "Win64") == 0) { - return std::unique_ptr<cmGlobalGenerator>( - new cmGlobalVisualStudio11Generator(cm, genName, "x64")); - } - if (strcmp(p, "ARM") == 0) { - return std::unique_ptr<cmGlobalGenerator>( - new cmGlobalVisualStudio11Generator(cm, genName, "ARM")); - } - - std::set<std::string> installedSDKs = - cmGlobalVisualStudio11Generator::GetInstalledWindowsCESDKs(); - - if (installedSDKs.find(p) == installedSDKs.end()) { - return std::unique_ptr<cmGlobalGenerator>(); - } - - auto ret = std::unique_ptr<cmGlobalVisualStudio11Generator>( - new cmGlobalVisualStudio11Generator(cm, name, p)); - ret->WindowsCEVersion = "8.00"; - return std::unique_ptr<cmGlobalGenerator>(std::move(ret)); - } - - cmDocumentationEntry GetDocumentation() const override - { - return { std::string(vs11generatorName) + " [arch]", - "Deprecated. Generates Visual Studio 2012 project files. " - "Optional [arch] can be \"Win64\" or \"ARM\"." }; - } - - std::vector<std::string> GetGeneratorNames() const override - { - std::vector<std::string> names; - names.push_back(vs11generatorName); - return names; - } - - std::vector<std::string> GetGeneratorNamesWithPlatform() const override - { - std::vector<std::string> names; - names.push_back(vs11generatorName + std::string(" ARM")); - names.push_back(vs11generatorName + std::string(" Win64")); - - std::set<std::string> installedSDKs = - cmGlobalVisualStudio11Generator::GetInstalledWindowsCESDKs(); - for (std::string const& i : installedSDKs) { - names.push_back(std::string(vs11generatorName) + " " + i); - } - - return names; - } - - bool SupportsToolset() const override { return true; } - bool SupportsPlatform() const override { return true; } - - std::vector<std::string> GetKnownPlatforms() const override - { - std::vector<std::string> platforms; - platforms.emplace_back("x64"); - platforms.emplace_back("Win32"); - platforms.emplace_back("ARM"); - - std::set<std::string> installedSDKs = - cmGlobalVisualStudio11Generator::GetInstalledWindowsCESDKs(); - for (std::string const& i : installedSDKs) { - platforms.emplace_back(i); - } - - return platforms; - } - - std::string GetDefaultPlatformName() const override { return "Win32"; } -}; - -std::unique_ptr<cmGlobalGeneratorFactory> -cmGlobalVisualStudio11Generator::NewFactory() -{ - return std::unique_ptr<cmGlobalGeneratorFactory>(new Factory); -} - cmGlobalVisualStudio11Generator::cmGlobalVisualStudio11Generator( cmake* cm, const std::string& name, std::string const& platformInGeneratorName) : cmGlobalVisualStudio10Generator(cm, name, platformInGeneratorName) { - std::string vc11Express; - this->ExpressEdition = cmSystemTools::ReadRegistryValue( - "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\11.0\\Setup\\VC;" - "ProductDir", - vc11Express, cmSystemTools::KeyWOW64_32); - this->DefaultPlatformToolset = "v110"; - this->DefaultCLFlagTableName = "v11"; - this->DefaultCSharpFlagTableName = "v11"; - this->DefaultLibFlagTableName = "v11"; - this->DefaultLinkFlagTableName = "v11"; - this->DefaultMasmFlagTableName = "v11"; - this->DefaultRCFlagTableName = "v11"; - this->Version = VSVersion::VS11; -} - -bool cmGlobalVisualStudio11Generator::MatchesGeneratorName( - const std::string& name) const -{ - std::string genName; - if (cmVS11GenName(name, genName)) { - return genName == this->GetName(); - } - return false; } void cmGlobalVisualStudio11Generator::EnableLanguage( diff --git a/Source/cmGlobalVisualStudio11Generator.h b/Source/cmGlobalVisualStudio11Generator.h index fd25984..ad12c1f 100644 --- a/Source/cmGlobalVisualStudio11Generator.h +++ b/Source/cmGlobalVisualStudio11Generator.h @@ -13,7 +13,6 @@ #include "cmGlobalVisualStudio10Generator.h" #include "cmTransformDepfile.h" -class cmGlobalGeneratorFactory; class cmMakefile; class cmake; @@ -21,10 +20,6 @@ class cmake; class cmGlobalVisualStudio11Generator : public cmGlobalVisualStudio10Generator { public: - static std::unique_ptr<cmGlobalGeneratorFactory> NewFactory(); - - bool MatchesGeneratorName(const std::string& name) const override; - void EnableLanguage(std::vector<std::string> const& languages, cmMakefile*, bool optional) override; @@ -58,8 +53,4 @@ protected: /** Return true if target system supports debugging deployment. */ bool TargetSystemSupportsDeployment() const override; - -private: - class Factory; - friend class Factory; }; diff --git a/Source/cmGlobalVisualStudio12Generator.cxx b/Source/cmGlobalVisualStudio12Generator.cxx index d417f9e..b7af31b 100644 --- a/Source/cmGlobalVisualStudio12Generator.cxx +++ b/Source/cmGlobalVisualStudio12Generator.cxx @@ -64,7 +64,7 @@ public: cmDocumentationEntry GetDocumentation() const override { return { std::string(vs12generatorName) + " [arch]", - "Generates Visual Studio 2013 project files. " + "Deprecated. Generates Visual Studio 2013 project files. " "Optional [arch] can be \"Win64\" or \"ARM\"." }; } diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index b254777..203bb09 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -330,23 +330,23 @@ void cmGlobalVisualStudio7Generator::Generate() } } - if (this->Version == VSVersion::VS11 && + if (this->Version == VSVersion::VS12 && !this->CMakeInstance->GetIsInTryCompile()) { - std::string cmakeWarnVS11; + std::string cmakeWarnVS12; if (cmValue cached = this->CMakeInstance->GetState()->GetCacheEntryValue( - "CMAKE_WARN_VS11")) { - this->CMakeInstance->MarkCliAsUsed("CMAKE_WARN_VS11"); - cmakeWarnVS11 = *cached; + "CMAKE_WARN_VS12")) { + this->CMakeInstance->MarkCliAsUsed("CMAKE_WARN_VS12"); + cmakeWarnVS12 = *cached; } else { - cmSystemTools::GetEnv("CMAKE_WARN_VS11", cmakeWarnVS11); + cmSystemTools::GetEnv("CMAKE_WARN_VS12", cmakeWarnVS12); } - if (cmakeWarnVS11.empty() || !cmIsOff(cmakeWarnVS11)) { + if (cmakeWarnVS12.empty() || !cmIsOff(cmakeWarnVS12)) { this->CMakeInstance->IssueMessage( MessageType::WARNING, - "The \"Visual Studio 11 2012\" generator is deprecated " + "The \"Visual Studio 12 2013\" generator is deprecated " "and will be removed in a future version of CMake." "\n" - "Add CMAKE_WARN_VS11=OFF to the cache to disable this warning."); + "Add CMAKE_WARN_VS12=OFF to the cache to disable this warning."); } } } diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index 6b024db..4d7571a 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -105,8 +105,6 @@ const char* cmGlobalVisualStudioGenerator::GetIDEVersion() const switch (this->Version) { case cmGlobalVisualStudioGenerator::VSVersion::VS9: return "9.0"; - case cmGlobalVisualStudioGenerator::VSVersion::VS11: - return "11.0"; case cmGlobalVisualStudioGenerator::VSVersion::VS12: return "12.0"; case cmGlobalVisualStudioGenerator::VSVersion::VS14: @@ -132,14 +130,6 @@ void cmGlobalVisualStudioGenerator::WriteSLNHeader(std::ostream& fout) fout << "Microsoft Visual Studio Solution File, Format Version 10.00\n"; fout << "# Visual Studio 2008\n"; break; - case cmGlobalVisualStudioGenerator::VSVersion::VS11: - fout << "Microsoft Visual Studio Solution File, Format Version 12.00\n"; - if (this->ExpressEdition) { - fout << "# Visual Studio Express 2012 for Windows Desktop\n"; - } else { - fout << "# Visual Studio 2012\n"; - } - break; case cmGlobalVisualStudioGenerator::VSVersion::VS12: fout << "Microsoft Visual Studio Solution File, Format Version 12.00\n"; if (this->ExpressEdition) { diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h index 52db98d..76713fa 100644 --- a/Source/cmGlobalVisualStudioGenerator.h +++ b/Source/cmGlobalVisualStudioGenerator.h @@ -10,7 +10,7 @@ #include <string> #include <vector> -#include "cm_codecvt.hxx" +#include "cm_codecvt_Encoding.hxx" #include "cmGlobalGenerator.h" #include "cmTargetDepend.h" @@ -35,7 +35,6 @@ public: enum class VSVersion : uint16_t { VS9 = 90, - VS11 = 110, VS12 = 120, /* VS13 = 130 was skipped */ VS14 = 140, @@ -120,9 +119,9 @@ public: /** Get encoding used by generator for generated source files */ - codecvt::Encoding GetMakefileEncoding() const override + codecvt_Encoding GetMakefileEncoding() const override { - return codecvt::ANSI; + return codecvt_Encoding::ANSI; } class TargetSet : public std::set<cmGeneratorTarget const*> diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx index 602b42f..9fe66d3 100644 --- a/Source/cmGlobalVisualStudioVersionedGenerator.cxx +++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx @@ -127,8 +127,6 @@ static unsigned int VSVersionToMajor( switch (v) { case cmGlobalVisualStudioGenerator::VSVersion::VS9: return 9; - case cmGlobalVisualStudioGenerator::VSVersion::VS11: - return 11; case cmGlobalVisualStudioGenerator::VSVersion::VS12: return 12; case cmGlobalVisualStudioGenerator::VSVersion::VS14: @@ -149,8 +147,6 @@ static const char* VSVersionToToolset( switch (v) { case cmGlobalVisualStudioGenerator::VSVersion::VS9: return "v90"; - case cmGlobalVisualStudioGenerator::VSVersion::VS11: - return "v110"; case cmGlobalVisualStudioGenerator::VSVersion::VS12: return "v120"; case cmGlobalVisualStudioGenerator::VSVersion::VS14: @@ -171,8 +167,6 @@ static std::string VSVersionToMajorString( switch (v) { case cmGlobalVisualStudioGenerator::VSVersion::VS9: return "9"; - case cmGlobalVisualStudioGenerator::VSVersion::VS11: - return "11"; case cmGlobalVisualStudioGenerator::VSVersion::VS12: return "12"; case cmGlobalVisualStudioGenerator::VSVersion::VS14: @@ -192,7 +186,6 @@ static const char* VSVersionToAndroidToolset( { switch (v) { case cmGlobalVisualStudioGenerator::VSVersion::VS9: - case cmGlobalVisualStudioGenerator::VSVersion::VS11: case cmGlobalVisualStudioGenerator::VSVersion::VS12: return ""; case cmGlobalVisualStudioGenerator::VSVersion::VS14: @@ -493,7 +486,6 @@ bool cmGlobalVisualStudioVersionedGenerator::MatchesGeneratorName( std::string genName; switch (this->Version) { case cmGlobalVisualStudioGenerator::VSVersion::VS9: - case cmGlobalVisualStudioGenerator::VSVersion::VS11: case cmGlobalVisualStudioGenerator::VSVersion::VS12: case cmGlobalVisualStudioGenerator::VSVersion::VS14: break; @@ -761,7 +753,6 @@ cmGlobalVisualStudioVersionedGenerator::GetAndroidApplicationTypeRevision() { switch (this->Version) { case cmGlobalVisualStudioGenerator::VSVersion::VS9: - case cmGlobalVisualStudioGenerator::VSVersion::VS11: case cmGlobalVisualStudioGenerator::VSVersion::VS12: return ""; case cmGlobalVisualStudioGenerator::VSVersion::VS14: diff --git a/Source/cmGlobalWatcomWMakeGenerator.h b/Source/cmGlobalWatcomWMakeGenerator.h index 5579120..8b24679 100644 --- a/Source/cmGlobalWatcomWMakeGenerator.h +++ b/Source/cmGlobalWatcomWMakeGenerator.h @@ -53,6 +53,8 @@ public: bool AllowNotParallel() const override { return false; } bool AllowDeleteOnError() const override { return false; } + bool IsGNUMakeJobServerAware() const override { return false; } + protected: std::vector<GeneratedMakeCommand> GenerateBuildCommand( const std::string& makeProgram, const std::string& projectName, diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index fd58f75..0472631 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -5155,6 +5155,10 @@ std::string cmGlobalXCodeGenerator::GetDeploymentPlatform(const cmMakefile* mf) case cmMakefile::AppleSDK::WatchSimulator: return "WATCHOS_DEPLOYMENT_TARGET"; + case cmMakefile::AppleSDK::XROS: + case cmMakefile::AppleSDK::XRSimulator: + return "XROS_DEPLOYMENT_TARGET"; + case cmMakefile::AppleSDK::MacOS: default: return "MACOSX_DEPLOYMENT_TARGET"; diff --git a/Source/cmLDConfigLDConfigTool.cxx b/Source/cmLDConfigLDConfigTool.cxx index 0752b33..154aa27 100644 --- a/Source/cmLDConfigLDConfigTool.cxx +++ b/Source/cmLDConfigLDConfigTool.cxx @@ -14,6 +14,7 @@ #include "cmRuntimeDependencyArchive.h" #include "cmSystemTools.h" #include "cmUVProcessChain.h" +#include "cmUVStream.h" cmLDConfigLDConfigTool::cmLDConfigLDConfigTool( cmRuntimeDependencyArchive* archive) @@ -43,14 +44,15 @@ bool cmLDConfigLDConfigTool::GetLDConfigPaths(std::vector<std::string>& paths) builder.SetBuiltinStream(cmUVProcessChainBuilder::Stream_OUTPUT) .AddCommand(ldConfigCommand); auto process = builder.Start(); - if (!process.Valid()) { + if (!process.Valid() || process.GetStatus(0).SpawnResult != 0) { this->Archive->SetError("Failed to start ldconfig process"); return false; } std::string line; static const cmsys::RegularExpression regex("^([^\t:]*):"); - while (std::getline(*process.OutputStream(), line)) { + cmUVPipeIStream output(process.GetLoop(), process.OutputStream()); + while (std::getline(output, line)) { cmsys::RegularExpressionMatch match; if (regex.find(line.c_str(), match)) { paths.push_back(match.match(1)); @@ -61,8 +63,7 @@ bool cmLDConfigLDConfigTool::GetLDConfigPaths(std::vector<std::string>& paths) this->Archive->SetError("Failed to wait on ldconfig process"); return false; } - auto status = process.GetStatus(); - if (!status[0] || status[0]->ExitStatus != 0) { + if (process.GetStatus(0).ExitStatus != 0) { this->Archive->SetError("Failed to run ldconfig"); return false; } diff --git a/Source/cmLinkDirectoriesCommand.cxx b/Source/cmLinkDirectoriesCommand.cxx index 1ec071b..6775a60 100644 --- a/Source/cmLinkDirectoriesCommand.cxx +++ b/Source/cmLinkDirectoriesCommand.cxx @@ -6,6 +6,7 @@ #include "cmExecutionStatus.h" #include "cmGeneratorExpression.h" +#include "cmList.h" #include "cmMakefile.h" #include "cmMessageType.h" #include "cmPolicies.h" @@ -39,7 +40,7 @@ bool cmLinkDirectoriesCommand(std::vector<std::string> const& args, AddLinkDir(mf, *i, directories); } - mf.AddLinkDirectory(cmJoin(directories, ";"), before); + mf.AddLinkDirectory(cmList::to_string(directories), before); return true; } diff --git a/Source/cmList.cxx b/Source/cmList.cxx index 022fcd2..3835e59 100644 --- a/Source/cmList.cxx +++ b/Source/cmList.cxx @@ -19,6 +19,7 @@ #include "cmAlgorithms.h" #include "cmGeneratorExpression.h" +#include "cmListFileCache.h" #include "cmRange.h" #include "cmStringAlgorithms.h" #include "cmStringReplaceHelper.h" @@ -802,11 +803,6 @@ cmList& cmList::transform(TransformAction action, return *this; } -std::string cmList::join(cm::string_view glue) const -{ - return cmJoin(this->Values, glue); -} - std::string& cmList::append(std::string& list, cm::string_view value) { if (list.empty()) { @@ -1001,3 +997,8 @@ cmList::container_type::iterator cmList::Insert( } return container.begin() + delta; } + +std::string const& cmList::ToString(BT<std::string> const& s) +{ + return s.Value; +} diff --git a/Source/cmList.h b/Source/cmList.h index eba0400..dc5850a 100644 --- a/Source/cmList.h +++ b/Source/cmList.h @@ -22,6 +22,9 @@ #include "cmValue.h" +template <typename T> +class BT; + /** * CMake lists management * A CMake list is a string where list elements are separated by the ';' @@ -936,7 +939,10 @@ public: std::vector<std::string> const& args, std::unique_ptr<TransformSelector> = {}); - std::string join(cm::string_view glue) const; + std::string join(cm::string_view glue) const + { + return cmList::Join(this->Values, glue); + } void swap(cmList& other) noexcept { this->Values.swap(other.Values); } @@ -1092,8 +1098,8 @@ public: return cmList::append(list, cm::string_view{ std::accumulate( std::next(first), last, *first, - [](std::string a, const std::string& b) { - return std::move(a) + + [](const std::string& a, const std::string& b) { + return a + std::string(cmList::element_separator) + b; }) }); } @@ -1116,6 +1122,13 @@ public: }) }); } + template <typename Range, + cm::enable_if_t<cm::is_range<Range>::value, int> = 0> + static std::string to_string(Range const& r) + { + return cmList::Join(r, cmList::element_separator); + } + // Non-members // =========== friend inline bool operator==(const cmList& lhs, const cmList& rhs) noexcept @@ -1185,6 +1198,27 @@ private: return container.begin() + delta; } + static std::string const& ToString(std::string const& s) { return s; } + static std::string ToString(cm::string_view s) { return std::string{ s }; } + static std::string const& ToString(BT<std::string> const&); + + template <typename Range> + static std::string Join(Range const& r, cm::string_view glue) + { + if (cm::size(r) == 0) { + return std::string{}; + } + + const auto sep = std::string{ glue }; + + std::string joined = cmList::ToString(*std::begin(r)); + for (auto it = std::next(std::begin(r)); it != std::end(r); ++it) { + joined += sep + cmList::ToString(*it); + } + + return joined; + } + container_type Values; }; diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 7ad4023..cf1eb96 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1431,11 +1431,14 @@ void cmLocalGenerator::GetDeviceLinkFlags( } this->AddVisibilityPresetFlags(linkFlags, target, "CUDA"); + this->GetGlobalGenerator()->EncodeLiteral(linkFlags); std::vector<std::string> linkOpts; target->GetLinkOptions(linkOpts, config, "CUDA"); + this->SetLinkScriptShell(this->GetGlobalGenerator()->GetUseLinkScript()); // LINK_OPTIONS are escaped. this->AppendCompileOptions(linkFlags, linkOpts); + this->SetLinkScriptShell(false); } void cmLocalGenerator::GetTargetFlags( @@ -1501,13 +1504,17 @@ void cmLocalGenerator::GetTargetFlags( } if (!sharedLibFlags.empty()) { + this->GetGlobalGenerator()->EncodeLiteral(sharedLibFlags); linkFlags.emplace_back(std::move(sharedLibFlags)); } std::vector<BT<std::string>> linkOpts = target->GetLinkOptions(config, linkLanguage); + this->SetLinkScriptShell(this->GetGlobalGenerator()->GetUseLinkScript()); // LINK_OPTIONS are escaped. this->AppendCompileOptions(linkFlags, linkOpts); + this->SetLinkScriptShell(false); + if (pcli) { this->OutputLinkLibraries(pcli, linkLineComputer, linkLibs, frameworkPath, linkPath); @@ -1581,13 +1588,16 @@ void cmLocalGenerator::GetTargetFlags( } if (!exeFlags.empty()) { + this->GetGlobalGenerator()->EncodeLiteral(exeFlags); linkFlags.emplace_back(std::move(exeFlags)); } std::vector<BT<std::string>> linkOpts = target->GetLinkOptions(config, linkLanguage); + this->SetLinkScriptShell(this->GetGlobalGenerator()->GetUseLinkScript()); // LINK_OPTIONS are escaped. this->AppendCompileOptions(linkFlags, linkOpts); + this->SetLinkScriptShell(false); } break; default: break; @@ -1603,6 +1613,7 @@ void cmLocalGenerator::GetTargetFlags( config); if (!extraLinkFlags.empty()) { + this->GetGlobalGenerator()->EncodeLiteral(extraLinkFlags); linkFlags.emplace_back(std::move(extraLinkFlags)); } } diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index af0e118..24ef5c2 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -198,7 +198,7 @@ void cmLocalVisualStudio7Generator::GenerateTarget(cmGeneratorTarget* target) // Intel Fortran always uses VS9 format ".vfproj" files. cmGlobalVisualStudioGenerator::VSVersion realVersion = gg->GetVersion(); if (this->FortranProject && - gg->GetVersion() >= cmGlobalVisualStudioGenerator::VSVersion::VS11) { + gg->GetVersion() >= cmGlobalVisualStudioGenerator::VSVersion::VS12) { gg->SetVersion(cmGlobalVisualStudioGenerator::VSVersion::VS9); } diff --git a/Source/cmLocalXCodeGenerator.cxx b/Source/cmLocalXCodeGenerator.cxx index 759ee7b..eb05424 100644 --- a/Source/cmLocalXCodeGenerator.cxx +++ b/Source/cmLocalXCodeGenerator.cxx @@ -83,6 +83,12 @@ void cmLocalXCodeGenerator::AddGeneratorSpecificInstallSetup(std::ostream& os) case cmMakefile::AppleSDK::WatchSimulator: platformName = "watchsimulator"; break; + case cmMakefile::AppleSDK::XROS: + platformName = "xros"; + break; + case cmMakefile::AppleSDK::XRSimulator: + platformName = "xrsimulator"; + break; case cmMakefile::AppleSDK::MacOS: break; } diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index 47ad749..3d7cd8b 100644 --- a/Source/cmMacroCommand.cxx +++ b/Source/cmMacroCommand.cxx @@ -12,6 +12,7 @@ #include "cmExecutionStatus.h" #include "cmFunctionBlocker.h" +#include "cmList.h" #include "cmListFileCache.h" #include "cmMakefile.h" #include "cmPolicies.h" @@ -66,8 +67,9 @@ bool cmMacroHelperCommand::operator()( std::string argcDef = std::to_string(expandedArgs.size()); auto eit = expandedArgs.begin() + (this->Args.size() - 1); - std::string expandedArgn = cmJoin(cmMakeRange(eit, expandedArgs.end()), ";"); - std::string expandedArgv = cmJoin(expandedArgs, ";"); + std::string expandedArgn = + cmList::to_string(cmMakeRange(eit, expandedArgs.end())); + std::string expandedArgv = cmList::to_string(expandedArgs); std::vector<std::string> variables; variables.reserve(this->Args.size() - 1); for (unsigned int j = 1; j < this->Args.size(); ++j) { diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 0af0ed0..16a5188 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -515,7 +515,7 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff, if (!hadNestedError) { // The command invocation requested that we report an error. std::string const error = - std::string(lff.OriginalName()) + " " + status.GetError(); + cmStrCat(lff.OriginalName(), ' ', status.GetError()); this->IssueMessage(MessageType::FATAL_ERROR, error); } result = false; @@ -1756,7 +1756,7 @@ void cmMakefile::Configure() bool hasVersion = false; // search for the right policy command for (cmListFileFunction const& func : listFile.Functions) { - if (func.LowerCaseName() == "cmake_minimum_required") { + if (func.LowerCaseName() == "cmake_minimum_required"_s) { hasVersion = true; break; } @@ -1803,7 +1803,7 @@ void cmMakefile::Configure() bool hasProject = false; // search for a project command for (cmListFileFunction const& func : listFile.Functions) { - if (func.LowerCaseName() == "project") { + if (func.LowerCaseName() == "project"_s) { hasProject = true; break; } @@ -1860,7 +1860,8 @@ void cmMakefile::ConfigureSubDirectory(cmMakefile* mf) cmSystemTools::Message(msg); } - std::string const currentStartFile = currentStart + "/CMakeLists.txt"; + std::string const currentStartFile = + cmStrCat(currentStart, "/CMakeLists.txt"); if (!cmSystemTools::FileExists(currentStartFile, true)) { // The file is missing. Check policy CMP0014. std::ostringstream e; @@ -1980,7 +1981,7 @@ void cmMakefile::AddIncludeDirectories(const std::vector<std::string>& incs, return; } - std::string entryString = cmJoin(incs, ";"); + std::string entryString = cmList::to_string(incs); if (before) { this->StateSnapshot.GetDirectory().PrependIncludeDirectoriesEntry( BT<std::string>(entryString, this->Backtrace)); @@ -2149,11 +2150,11 @@ void cmMakefile::AddGlobalLinkInformation(cmTarget& target) for (auto j = linkLibs.begin(); j != linkLibs.end(); ++j) { std::string libraryName = *j; cmTargetLinkLibraryType libType = GENERAL_LibraryType; - if (libraryName == "optimized") { + if (libraryName == "optimized"_s) { libType = OPTIMIZED_LibraryType; ++j; libraryName = *j; - } else if (libraryName == "debug") { + } else if (libraryName == "debug"_s) { libType = DEBUG_LibraryType; ++j; libraryName = *j; @@ -2520,7 +2521,7 @@ bool cmMakefile::IsSet(const std::string& name) const bool cmMakefile::PlatformIs32Bit() const { if (cmValue plat_abi = this->GetDefinition("CMAKE_INTERNAL_PLATFORM_ABI")) { - if (*plat_abi == "ELF X32") { + if (*plat_abi == "ELF X32"_s) { return false; } } @@ -2541,7 +2542,7 @@ bool cmMakefile::PlatformIs64Bit() const bool cmMakefile::PlatformIsx32() const { if (cmValue plat_abi = this->GetDefinition("CMAKE_INTERNAL_PLATFORM_ABI")) { - if (*plat_abi == "ELF X32") { + if (*plat_abi == "ELF X32"_s) { return true; } } @@ -2565,11 +2566,13 @@ cmMakefile::AppleSDK cmMakefile::GetAppleSDKType() const { "iphonesimulator", AppleSDK::IPhoneSimulator }, { "watchos", AppleSDK::WatchOS }, { "watchsimulator", AppleSDK::WatchSimulator }, + { "xros", AppleSDK::XROS }, + { "xrsimulator", AppleSDK::XRSimulator }, }; for (auto const& entry : sdkDatabase) { if (cmHasPrefix(sdkRoot, entry.name) || - sdkRoot.find(std::string("/") + entry.name) != std::string::npos) { + sdkRoot.find(cmStrCat('/', entry.name)) != std::string::npos) { return entry.sdk; } } @@ -3004,12 +3007,11 @@ cm::optional<std::string> cmMakefile::DeferGetCallIds() const { cm::optional<std::string> ids; if (this->Defer) { - ids = cmJoin( + ids = cmList::to_string( cmMakeRange(this->Defer->Commands) .filter([](DeferCommand const& dc) -> bool { return !dc.Id.empty(); }) .transform( - [](DeferCommand const& dc) -> std::string const& { return dc.Id; }), - ";"); + [](DeferCommand const& dc) -> std::string const& { return dc.Id; })); } return ids; } @@ -3152,15 +3154,15 @@ MessageType cmMakefile::ExpandVariablesInStringNew( char nextc = *next; if (nextc == 't') { result.append(last, in - last); - result.append("\t"); + result.push_back('\t'); last = next + 1; } else if (nextc == 'n') { result.append(last, in - last); - result.append("\n"); + result.push_back('\n'); last = next + 1; } else if (nextc == 'r') { result.append(last, in - last); - result.append("\r"); + result.push_back('\r'); last = next + 1; } else if (nextc == ';' && openstack.empty()) { // Handled in ExpandListArgument; pass the backslash literally. @@ -3237,9 +3239,9 @@ MessageType cmMakefile::ExpandVariablesInStringNew( errorstr += "Invalid character (\'"; errorstr += inc; result.append(last, in - last); - errorstr += "\') in a variable name: " - "'" + - result.substr(openstack.back().loc) + "'"; + errorstr += cmStrCat("\') in a variable name: " + "'", + result.substr(openstack.back().loc), '\''); mtype = MessageType::FATAL_ERROR; error = true; } @@ -3646,13 +3648,13 @@ void cmMakefile::EnableLanguage(std::vector<std::string> const& languages, } } if (!duplicate_languages.empty()) { - auto quantity = duplicate_languages.size() == 1 ? std::string(" has") - : std::string("s have"); - this->IssueMessage(MessageType::AUTHOR_WARNING, - "Languages to be enabled may not be specified more " - "than once at the same time. The following language" + - quantity + " been specified multiple times: " + - cmJoin(duplicate_languages, ", ")); + auto quantity = duplicate_languages.size() == 1 ? " has"_s : "s have"_s; + this->IssueMessage( + MessageType::AUTHOR_WARNING, + cmStrCat("Languages to be enabled may not be specified more " + "than once at the same time. The following language", + quantity, " been specified multiple times: ", + cmJoin(duplicate_languages, ", "))); } } @@ -3663,7 +3665,7 @@ void cmMakefile::EnableLanguage(std::vector<std::string> const& languages, std::vector<std::string> languages_for_RC; languages_without_RC.reserve(unique_languages.size()); for (std::string const& language : unique_languages) { - if (language == "RC") { + if (language == "RC"_s) { languages_for_RC.push_back(language); } else { languages_without_RC.push_back(language); @@ -3697,8 +3699,9 @@ int cmMakefile::TryCompile(const std::string& srcdir, cmWorkingDirectory workdir(bindir); if (workdir.Failed()) { this->IssueMessage(MessageType::FATAL_ERROR, - "Failed to set working directory to " + bindir + " : " + - std::strerror(workdir.GetLastResult())); + cmStrCat("Failed to set working directory to ", bindir, + " : ", + std::strerror(workdir.GetLastResult()))); cmSystemTools::SetFatalErrorOccurred(); this->IsSourceFileTryCompile = false; return 1; @@ -3926,7 +3929,7 @@ std::string cmMakefile::GetModulesFile(const std::string& filename, if (!moduleInCMakeModulePath.empty() && !moduleInCMakeRoot.empty()) { cmValue currentFile = this->GetDefinition("CMAKE_CURRENT_LIST_FILE"); - std::string mods = cmSystemTools::GetCMakeRoot() + "/Modules/"; + std::string mods = cmStrCat(cmSystemTools::GetCMakeRoot(), "/Modules/"); if (currentFile && cmSystemTools::IsSubDirectory(*currentFile, mods)) { switch (this->GetPolicyStatus(cmPolicies::CMP0017)) { case cmPolicies::WARN: { @@ -3985,8 +3988,9 @@ void cmMakefile::ConfigureString(const std::string& input, std::string& output, cmValue def = this->GetDefinition(this->cmDefineRegex.match(2)); if (!cmIsOff(def)) { const std::string indentation = this->cmDefineRegex.match(1); - cmSystemTools::ReplaceString(line, "#" + indentation + "cmakedefine", - "#" + indentation + "define"); + cmSystemTools::ReplaceString(line, + cmStrCat("#", indentation, "cmakedefine"), + cmStrCat("#", indentation, "define")); output += line; } else { output += "/* #undef "; @@ -3996,8 +4000,9 @@ void cmMakefile::ConfigureString(const std::string& input, std::string& output, } else if (this->cmDefine01Regex.find(line)) { const std::string indentation = this->cmDefine01Regex.match(1); cmValue def = this->GetDefinition(this->cmDefine01Regex.match(2)); - cmSystemTools::ReplaceString(line, "#" + indentation + "cmakedefine01", - "#" + indentation + "define"); + cmSystemTools::ReplaceString(line, + cmStrCat("#", indentation, "cmakedefine01"), + cmStrCat("#", indentation, "define")); output += line; if (!cmIsOff(def)) { output += " 1"; @@ -4035,12 +4040,12 @@ int cmMakefile::ConfigureFile(const std::string& infile, { int res = 1; if (!this->CanIWriteThisFile(outfile)) { - cmSystemTools::Error("Attempt to write file: " + outfile + - " into a source directory."); + cmSystemTools::Error(cmStrCat("Attempt to write file: ", outfile, + " into a source directory.")); return 0; } if (!cmSystemTools::FileExists(infile)) { - cmSystemTools::Error("File " + infile + " does not exist."); + cmSystemTools::Error(cmStrCat("File ", infile, " does not exist.")); return 0; } std::string soutfile = outfile; @@ -4153,14 +4158,14 @@ cmValue cmMakefile::GetProperty(const std::string& prop) const { // Check for computed properties. static std::string output; - if (prop == "TESTS") { + if (prop == "TESTS"_s) { std::vector<std::string> keys; // get list of keys const auto* t = this; std::transform( t->Tests.begin(), t->Tests.end(), std::back_inserter(keys), [](decltype(t->Tests)::value_type const& pair) { return pair.first; }); - output = cmJoin(keys, ";"); + output = cmList::to_string(keys); return cmValue(output); } @@ -4613,7 +4618,7 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id, } // Deprecate old policies. - if (status == cmPolicies::OLD && id <= cmPolicies::CMP0114 && + if (status == cmPolicies::OLD && id <= cmPolicies::CMP0120 && !(this->GetCMakeInstance()->GetIsInTryCompile() && ( // Policies set by cmCoreTryCompile::TryCompileCode. diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 7005942..79a98cd 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -561,6 +561,8 @@ public: AppleTVSimulator, WatchOS, WatchSimulator, + XROS, + XRSimulator, }; /** What SDK type points CMAKE_OSX_SYSROOT to? */ diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 5f27856..5e3bf61 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -17,7 +17,7 @@ #include <cmext/algorithm> #include <cmext/string_view> -#include "cm_codecvt.hxx" +#include "cm_codecvt_Encoding.hxx" #include "cmComputeLinkInformation.h" #include "cmCustomCommand.h" @@ -126,8 +126,11 @@ void cmMakefileTargetGenerator::GetDeviceLinkFlags( std::vector<std::string> linkOpts; this->GeneratorTarget->GetLinkOptions(linkOpts, this->GetConfigName(), linkLanguage); + this->LocalGenerator->SetLinkScriptShell( + this->GlobalGenerator->GetUseLinkScript()); // LINK_OPTIONS are escaped. this->LocalGenerator->AppendCompileOptions(linkFlags, linkOpts); + this->LocalGenerator->SetLinkScriptShell(false); } void cmMakefileTargetGenerator::GetTargetLinkFlags( @@ -144,8 +147,11 @@ void cmMakefileTargetGenerator::GetTargetLinkFlags( std::vector<std::string> opts; this->GeneratorTarget->GetLinkOptions(opts, this->GetConfigName(), linkLanguage); + this->LocalGenerator->SetLinkScriptShell( + this->GlobalGenerator->GetUseLinkScript()); // LINK_OPTIONS are escaped. this->LocalGenerator->AppendCompileOptions(flags, opts); + this->LocalGenerator->SetLinkScriptShell(false); this->LocalGenerator->AppendPositionIndependentLinkerFlags( flags, this->GeneratorTarget, this->GetConfigName(), linkLanguage); @@ -2129,12 +2135,12 @@ std::string cmMakefileTargetGenerator::CreateResponseFile( // FIXME: Find a better way to determine the response file encoding, // perhaps using tool-specific platform information variables. // For now, use the makefile encoding as a heuristic. - codecvt::Encoding responseEncoding = + codecvt_Encoding responseEncoding = this->GlobalGenerator->GetMakefileEncoding(); // Non-MSVC tooling doesn't understand BOM encoded files. - if (responseEncoding == codecvt::UTF8_WITH_BOM && + if (responseEncoding == codecvt_Encoding::UTF8_WITH_BOM && (language == "CUDA" || !this->Makefile->IsOn("MSVC"))) { - responseEncoding = codecvt::UTF8; + responseEncoding = codecvt_Encoding::UTF8; } // Create the response file. diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 063ca6b..a5280fb 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -952,8 +952,6 @@ void cmNinjaNormalTargetGenerator::WriteNvidiaDeviceLinkStatement( this->addPoolNinjaVariable("JOB_POOL_LINK", genTarget, vars); - vars["LINK_FLAGS"] = globalGen->EncodeLiteral(vars["LINK_FLAGS"]); - vars["MANIFESTS"] = this->GetManifests(config); vars["LINK_PATH"] = frameworkPath + linkPath; @@ -1271,8 +1269,6 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement( vars["LINK_FLAGS"], this->GetGeneratorTarget(), this->TargetLinkLanguage(config)); - vars["LINK_FLAGS"] = globalGen->EncodeLiteral(vars["LINK_FLAGS"]); - vars["MANIFESTS"] = this->GetManifests(config); vars["AIX_EXPORTS"] = this->GetAIXExports(config); diff --git a/Source/cmParseArgumentsCommand.cxx b/Source/cmParseArgumentsCommand.cxx index b0462f0..f193ed9 100644 --- a/Source/cmParseArgumentsCommand.cxx +++ b/Source/cmParseArgumentsCommand.cxx @@ -20,7 +20,9 @@ #include "cmSystemTools.h" #include "cmValue.h" -static std::string EscapeArg(const std::string& arg) +namespace { + +std::string EscapeArg(const std::string& arg) { // replace ";" with "\;" so output argument lists will split correctly std::string escapedArg; @@ -33,14 +35,12 @@ static std::string EscapeArg(const std::string& arg) return escapedArg; } -static std::string JoinList(std::vector<std::string> const& arg, bool escape) +std::string JoinList(std::vector<std::string> const& arg, bool escape) { - return escape ? cmJoin(cmMakeRange(arg).transform(EscapeArg), ";") - : cmJoin(cmMakeRange(arg), ";"); + return escape ? cmList::to_string(cmMakeRange(arg).transform(EscapeArg)) + : cmList::to_string(cmMakeRange(arg)); } -namespace { - using options_map = std::map<std::string, bool>; using single_map = std::map<std::string, std::string>; using multi_map = @@ -108,8 +108,9 @@ static void PassParsedArguments( } if (!keywordsMissingValues.empty()) { - makefile.AddDefinition(prefix + "KEYWORDS_MISSING_VALUES", - cmJoin(cmMakeRange(keywordsMissingValues), ";")); + makefile.AddDefinition( + prefix + "KEYWORDS_MISSING_VALUES", + cmList::to_string(cmMakeRange(keywordsMissingValues))); } else { makefile.RemoveDefinition(prefix + "KEYWORDS_MISSING_VALUES"); } diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index a0030d3..25af6a8 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -459,7 +459,11 @@ class cmMakefile; SELECT(POLICY, CMP0151, \ "AUTOMOC include directory is a system include directory by " \ "default.", \ - 3, 27, 0, cmPolicies::WARN) + 3, 27, 0, cmPolicies::WARN) \ + SELECT( \ + POLICY, CMP0152, \ + "file(REAL_PATH) resolves symlinks before collapsing ../ components.", 3, \ + 28, 0, cmPolicies::WARN) #define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1) #define CM_FOR_EACH_POLICY_ID(POLICY) \ diff --git a/Source/cmSeparateArgumentsCommand.cxx b/Source/cmSeparateArgumentsCommand.cxx index 17285e7..3576e4f 100644 --- a/Source/cmSeparateArgumentsCommand.cxx +++ b/Source/cmSeparateArgumentsCommand.cxx @@ -9,6 +9,7 @@ #include "cmArgumentParser.h" #include "cmExecutionStatus.h" +#include "cmList.h" #include "cmMakefile.h" #include "cmRange.h" #include "cmStringAlgorithms.h" @@ -159,7 +160,7 @@ bool cmSeparateArgumentsCommand(std::vector<std::string> const& args, pos += 2; } }); - auto value = cmJoin(values, ";"); + auto value = cmList::to_string(values); status.GetMakefile().AddDefinition(var, value); return true; diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx index 040eb08..c4bb949 100644 --- a/Source/cmSetCommand.cxx +++ b/Source/cmSetCommand.cxx @@ -3,6 +3,7 @@ #include "cmSetCommand.h" #include "cmExecutionStatus.h" +#include "cmList.h" #include "cmMakefile.h" #include "cmMessageType.h" #include "cmRange.h" @@ -103,7 +104,8 @@ bool cmSetCommand(std::vector<std::string> const& args, } // collect any values into a single semi-colon separated value list - value = cmJoin(cmMakeRange(args).advance(1).retreat(ignoreLastArgs), ";"); + value = + cmList::to_string(cmMakeRange(args).advance(1).retreat(ignoreLastArgs)); if (parentScope) { status.GetMakefile().RaiseScope(variable, value.c_str()); diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index 3403745..1be680a 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -8,6 +8,7 @@ #include <cmext/string_view> #include "cmGlobalGenerator.h" +#include "cmList.h" #include "cmListFileCache.h" #include "cmMakefile.h" #include "cmMessageType.h" @@ -390,7 +391,7 @@ cmValue cmSourceFile::GetProperty(const std::string& prop) const } static std::string output; - output = cmJoin(this->IncludeDirectories, ";"); + output = cmList::to_string(this->IncludeDirectories); return cmValue(output); } @@ -400,7 +401,7 @@ cmValue cmSourceFile::GetProperty(const std::string& prop) const } static std::string output; - output = cmJoin(this->CompileOptions, ";"); + output = cmList::to_string(this->CompileOptions); return cmValue(output); } @@ -410,7 +411,7 @@ cmValue cmSourceFile::GetProperty(const std::string& prop) const } static std::string output; - output = cmJoin(this->CompileDefinitions, ";"); + output = cmList::to_string(this->CompileDefinitions); return cmValue(output); } diff --git a/Source/cmSourceGroupCommand.cxx b/Source/cmSourceGroupCommand.cxx index bb75a14..4b1685f 100644 --- a/Source/cmSourceGroupCommand.cxx +++ b/Source/cmSourceGroupCommand.cxx @@ -4,6 +4,7 @@ #include <cstddef> #include <map> +#include <memory> #include <set> #include <utility> @@ -11,6 +12,8 @@ #include "cmExecutionStatus.h" #include "cmMakefile.h" +#include "cmSourceFile.h" +#include "cmSourceFileLocation.h" #include "cmSourceGroup.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" @@ -194,7 +197,10 @@ bool cmSourceGroupCommand(std::vector<std::string> const& args, // If only two arguments are given, the pre-1.8 version of the // command is being invoked. - if (args.size() == 2 && args[1] != "FILES") { + bool isShortTreeSyntax = + ((args.size() == 2) && (args[0] == kTreeOptionName) && + cmSystemTools::FileIsDirectory(args[1])); + if (args.size() == 2 && args[1] != kFilesOptionName && !isShortTreeSyntax) { cmSourceGroup* sg = mf.GetOrCreateSourceGroup(args[0]); if (!sg) { @@ -274,8 +280,19 @@ static bool processTree(cmMakefile& mf, ParsedArguments& parsedArguments, ? "" : parsedArguments[kPrefixOptionName].front(); - const std::vector<std::string> filesVector = prepareFilesPathsForTree( - parsedArguments[kFilesOptionName], mf.GetCurrentSourceDirectory()); + std::vector<std::string> files = parsedArguments[kFilesOptionName]; + if (files.empty()) { + const std::vector<std::unique_ptr<cmSourceFile>>& srcFiles = + mf.GetSourceFiles(); + for (const auto& srcFile : srcFiles) { + if (!srcFile->GetIsGenerated()) { + files.push_back(srcFile->GetLocation().GetFullPath()); + } + } + } + + const std::vector<std::string> filesVector = + prepareFilesPathsForTree(files, mf.GetCurrentSourceDirectory()); if (!rootIsPrefix(root, filesVector, errorMsg)) { return false; diff --git a/Source/cmState.cxx b/Source/cmState.cxx index 2596d8c..d41e8e5 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -17,6 +17,7 @@ #include "cmDefinitions.h" #include "cmExecutionStatus.h" #include "cmGlobVerificationManager.h" +#include "cmList.h" #include "cmListFileCache.h" #include "cmMakefile.h" #include "cmMessageType.h" @@ -584,10 +585,10 @@ cmValue cmState::GetGlobalProperty(const std::string& prop) { if (prop == "CACHE_VARIABLES") { std::vector<std::string> cacheKeys = this->GetCacheEntryKeys(); - this->SetGlobalProperty("CACHE_VARIABLES", cmJoin(cacheKeys, ";")); + this->SetGlobalProperty("CACHE_VARIABLES", cmList::to_string(cacheKeys)); } else if (prop == "COMMANDS") { std::vector<std::string> commands = this->GetCommandNames(); - this->SetGlobalProperty("COMMANDS", cmJoin(commands, ";")); + this->SetGlobalProperty("COMMANDS", cmList::to_string(commands)); } else if (prop == "IN_TRY_COMPILE") { this->SetGlobalProperty( "IN_TRY_COMPILE", @@ -596,8 +597,7 @@ cmValue cmState::GetGlobalProperty(const std::string& prop) this->SetGlobalProperty("GENERATOR_IS_MULTI_CONFIG", this->IsGeneratorMultiConfig ? "1" : "0"); } else if (prop == "ENABLED_LANGUAGES") { - std::string langs; - langs = cmJoin(this->EnabledLanguages, ";"); + auto langs = cmList::to_string(this->EnabledLanguages); this->SetGlobalProperty("ENABLED_LANGUAGES", langs); } else if (prop == "CMAKE_ROLE") { std::string mode = this->GetModeString(); diff --git a/Source/cmStateDirectory.cxx b/Source/cmStateDirectory.cxx index 6e6fcbd..39353f3 100644 --- a/Source/cmStateDirectory.cxx +++ b/Source/cmStateDirectory.cxx @@ -13,6 +13,7 @@ #include <cmext/string_view> #include "cmAlgorithms.h" +#include "cmList.h" #include "cmListFileCache.h" #include "cmProperty.h" #include "cmPropertyMap.h" @@ -20,7 +21,6 @@ #include "cmState.h" #include "cmStatePrivate.h" #include "cmStateTypes.h" -#include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include "cmValue.h" @@ -381,15 +381,15 @@ cmValue cmStateDirectory::GetProperty(const std::string& prop, for (cmStateSnapshot const& ci : children) { child_dirs.push_back(ci.GetDirectory().GetCurrentSource()); } - output = cmJoin(child_dirs, ";"); + output = cmList::to_string(child_dirs); return cmValue(output); } if (prop == kBUILDSYSTEM_TARGETS) { - output = cmJoin(this->DirectoryState->NormalTargetNames, ";"); + output = cmList::to_string(this->DirectoryState->NormalTargetNames); return cmValue(output); } if (prop == "IMPORTED_TARGETS"_s) { - output = cmJoin(this->DirectoryState->ImportedTargetNames, ";"); + output = cmList::to_string(this->DirectoryState->ImportedTargetNames); return cmValue(output); } @@ -401,38 +401,38 @@ cmValue cmStateDirectory::GetProperty(const std::string& prop, snp = snp.GetCallStackParent(); } std::reverse(listFiles.begin(), listFiles.end()); - output = cmJoin(listFiles, ";"); + output = cmList::to_string(listFiles); return cmValue(output); } if (prop == "CACHE_VARIABLES") { - output = cmJoin(this->Snapshot_.State->GetCacheEntryKeys(), ";"); + output = cmList::to_string(this->Snapshot_.State->GetCacheEntryKeys()); return cmValue(output); } if (prop == "VARIABLES") { std::vector<std::string> res = this->Snapshot_.ClosureKeys(); cm::append(res, this->Snapshot_.State->GetCacheEntryKeys()); std::sort(res.begin(), res.end()); - output = cmJoin(res, ";"); + output = cmList::to_string(res); return cmValue(output); } if (prop == "INCLUDE_DIRECTORIES") { - output = cmJoin(this->GetIncludeDirectoriesEntries(), ";"); + output = cmList::to_string(this->GetIncludeDirectoriesEntries()); return cmValue(output); } if (prop == "COMPILE_OPTIONS") { - output = cmJoin(this->GetCompileOptionsEntries(), ";"); + output = cmList::to_string(this->GetCompileOptionsEntries()); return cmValue(output); } if (prop == "COMPILE_DEFINITIONS") { - output = cmJoin(this->GetCompileDefinitionsEntries(), ";"); + output = cmList::to_string(this->GetCompileDefinitionsEntries()); return cmValue(output); } if (prop == "LINK_OPTIONS") { - output = cmJoin(this->GetLinkOptionsEntries(), ";"); + output = cmList::to_string(this->GetLinkOptionsEntries()); return cmValue(output); } if (prop == "LINK_DIRECTORIES") { - output = cmJoin(this->GetLinkDirectoriesEntries(), ";"); + output = cmList::to_string(this->GetLinkDirectoriesEntries()); return cmValue(output); } diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index b53adf8..1281bc6 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -811,12 +811,12 @@ std::pair<bool, cmValue> FileSetType::ReadProperties( did_read = true; } else if (prop == this->SelfEntries.PropertyName) { static std::string output; - output = cmJoin(this->SelfEntries.Entries, ";"_s); + output = cmList::to_string(this->SelfEntries.Entries); value = cmValue(output); did_read = true; } else if (prop == this->InterfaceEntries.PropertyName) { static std::string output; - output = cmJoin(this->InterfaceEntries.Entries, ";"_s); + output = cmList::to_string(this->InterfaceEntries.Entries); value = cmValue(output); did_read = true; } else if (cmHasPrefix(prop, this->DirectoryPrefix)) { @@ -899,7 +899,7 @@ std::pair<bool, cmValue> UsageRequirementProperty::Read( if (!this->Entries.empty()) { // Storage to back the returned `cmValue`. static std::string output; - output = cmJoin(this->Entries, ";"); + output = cmList::to_string(this->Entries); value = cmValue(output); } did_read = true; @@ -2130,7 +2130,7 @@ cmValue cmTargetInternals::GetFileSetDirectories( return nullptr; } static std::string output; - output = cmJoin(fileSet->GetDirectoryEntries(), ";"_s); + output = cmList::to_string(fileSet->GetDirectoryEntries()); return cmValue(output); } @@ -2150,7 +2150,7 @@ cmValue cmTargetInternals::GetFileSetPaths(cmTarget const* self, return nullptr; } static std::string output; - output = cmJoin(fileSet->GetFileEntries(), ";"_s); + output = cmList::to_string(fileSet->GetFileEntries()); return cmValue(output); } @@ -2495,7 +2495,7 @@ cmValue cmTarget::GetProperty(const std::string& prop) const [](const BT<std::pair<std::string, bool>>& item) -> std::string { return item.Value.first; }); - output = cmJoin(utilities, ";"); + output = cmList::to_string(utilities); return cmValue(output); } if (prop == propIMPORTED) { @@ -2779,6 +2779,8 @@ std::string cmTarget::ImportedGetFullPath( case cmStateEnums::RuntimeBinaryArtifact: if (loc) { result = *loc; + } else if (imp) { + result = *imp; } else { std::string impProp = cmStrCat("IMPORTED_LOCATION", suffix); if (cmValue config_location = this->GetProperty(impProp)) { @@ -2787,6 +2789,16 @@ std::string cmTarget::ImportedGetFullPath( this->GetProperty("IMPORTED_LOCATION")) { result = *location; } + if (result.empty() && + (this->GetType() == cmStateEnums::SHARED_LIBRARY || + this->IsExecutableWithExports())) { + impProp = cmStrCat("IMPORTED_IMPLIB", suffix); + if (cmValue config_implib = this->GetProperty(impProp)) { + result = *config_implib; + } else if (cmValue implib = this->GetProperty("IMPORTED_IMPLIB")) { + result = *implib; + } + } } break; @@ -2812,7 +2824,10 @@ std::string cmTarget::ImportedGetFullPath( std::string unset; std::string configuration; - if (artifact == cmStateEnums::RuntimeBinaryArtifact) { + if (this->GetType() == cmStateEnums::SHARED_LIBRARY && + artifact == cmStateEnums::RuntimeBinaryArtifact) { + unset = "IMPORTED_LOCATION or IMPORTED_IMPLIB"; + } else if (artifact == cmStateEnums::RuntimeBinaryArtifact) { unset = "IMPORTED_LOCATION"; } else if (artifact == cmStateEnums::ImportLibraryArtifact) { unset = "IMPORTED_IMPLIB"; @@ -2985,11 +3000,10 @@ bool cmTarget::GetMappedConfig(std::string const& desired_config, cmValue& loc, } // If we needed to find one of the mapped configurations but did not - // On a DLL platform there may be only IMPORTED_IMPLIB for a shared - // library or an executable with exports. - bool allowImp = (this->IsDLLPlatform() && - (this->GetType() == cmStateEnums::SHARED_LIBRARY || - this->IsExecutableWithExports())) || + // There may be only IMPORTED_IMPLIB for a shared library or an executable + // with exports. + bool allowImp = (this->GetType() == cmStateEnums::SHARED_LIBRARY || + this->IsExecutableWithExports()) || (this->IsAIX() && this->IsExecutableWithExports()) || (this->GetMakefile()->PlatformSupportsAppleTextStubs() && this->IsSharedLibraryWithExports()); diff --git a/Source/cmTargetCompileFeaturesCommand.cxx b/Source/cmTargetCompileFeaturesCommand.cxx index aa1abdd..37c125b 100644 --- a/Source/cmTargetCompileFeaturesCommand.cxx +++ b/Source/cmTargetCompileFeaturesCommand.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTargetCompileFeaturesCommand.h" +#include "cmList.h" #include "cmMakefile.h" #include "cmMessageType.h" #include "cmStandardLevelResolver.h" @@ -43,7 +44,7 @@ private: std::string Join(const std::vector<std::string>& content) override { - return cmJoin(content, ";"); + return cmList::to_string(content); } }; diff --git a/Source/cmTargetCompileOptionsCommand.cxx b/Source/cmTargetCompileOptionsCommand.cxx index 8ca3842..e73a75f 100644 --- a/Source/cmTargetCompileOptionsCommand.cxx +++ b/Source/cmTargetCompileOptionsCommand.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTargetCompileOptionsCommand.h" +#include "cmList.h" #include "cmListFileCache.h" #include "cmMakefile.h" #include "cmMessageType.h" @@ -44,7 +45,7 @@ private: std::string Join(const std::vector<std::string>& content) override { - return cmJoin(content, ";"); + return cmList::to_string(content); } }; diff --git a/Source/cmTargetLinkDirectoriesCommand.cxx b/Source/cmTargetLinkDirectoriesCommand.cxx index 3ba27a8..dddb348 100644 --- a/Source/cmTargetLinkDirectoriesCommand.cxx +++ b/Source/cmTargetLinkDirectoriesCommand.cxx @@ -3,6 +3,7 @@ #include "cmTargetLinkDirectoriesCommand.h" #include "cmGeneratorExpression.h" +#include "cmList.h" #include "cmListFileCache.h" #include "cmMakefile.h" #include "cmMessageType.h" @@ -58,7 +59,7 @@ std::string TargetLinkDirectoriesImpl::Join( directories.push_back(unixPath); } - return cmJoin(directories, ";"); + return cmList::to_string(directories); } } // namespace diff --git a/Source/cmTargetLinkOptionsCommand.cxx b/Source/cmTargetLinkOptionsCommand.cxx index 3ea2d71..cd93835 100644 --- a/Source/cmTargetLinkOptionsCommand.cxx +++ b/Source/cmTargetLinkOptionsCommand.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTargetLinkOptionsCommand.h" +#include "cmList.h" #include "cmListFileCache.h" #include "cmMakefile.h" #include "cmMessageType.h" @@ -36,7 +37,7 @@ private: std::string Join(const std::vector<std::string>& content) override { - return cmJoin(content, ";"); + return cmList::to_string(content); } }; diff --git a/Source/cmTargetPrecompileHeadersCommand.cxx b/Source/cmTargetPrecompileHeadersCommand.cxx index 4dd158d..0173a92 100644 --- a/Source/cmTargetPrecompileHeadersCommand.cxx +++ b/Source/cmTargetPrecompileHeadersCommand.cxx @@ -5,6 +5,7 @@ #include <utility> #include "cmGeneratorExpression.h" +#include "cmList.h" #include "cmListFileCache.h" #include "cmMakefile.h" #include "cmMessageType.h" @@ -73,7 +74,7 @@ private: std::string Join(const std::vector<std::string>& content) override { - return cmJoin(content, ";"); + return cmList::to_string(content); } }; diff --git a/Source/cmTargetSourcesCommand.cxx b/Source/cmTargetSourcesCommand.cxx index 12328b1..3d484f5 100644 --- a/Source/cmTargetSourcesCommand.cxx +++ b/Source/cmTargetSourcesCommand.cxx @@ -98,7 +98,7 @@ private: std::string Join(const std::vector<std::string>& content) override { - return cmJoin(content, ";"); + return cmList::to_string(content); } enum class IsInterface diff --git a/Source/cmUVProcessChain.cxx b/Source/cmUVProcessChain.cxx index ed5f38b..3de7ae5 100644 --- a/Source/cmUVProcessChain.cxx +++ b/Source/cmUVProcessChain.cxx @@ -5,11 +5,9 @@ #include "cmUVProcessChain.h" #include <array> -#include <cassert> #include <csignal> #include <cstdio> #include <istream> // IWYU pragma: keep -#include <iterator> #include <type_traits> #include <utility> @@ -19,43 +17,24 @@ #include "cmGetPipes.h" #include "cmUVHandlePtr.h" -#include "cmUVStreambuf.h" struct cmUVProcessChain::InternalData { - struct BasicStreamData + struct StreamData { - cmUVStreambuf Streambuf; - cm::uv_pipe_ptr BuiltinStream; + int BuiltinStream = -1; uv_stdio_container_t Stdio; }; - template <typename IOStream> - struct StreamData : public BasicStreamData - { - StreamData() - : BuiltinIOStream(&this->Streambuf) - { - } - - IOStream BuiltinIOStream; - - IOStream* GetBuiltinStream() - { - if (this->BuiltinStream.get()) { - return &this->BuiltinIOStream; - } - return nullptr; - } - }; - struct ProcessData { cmUVProcessChain::InternalData* Data; cm::uv_process_ptr Process; + cm::uv_pipe_ptr InputPipe; cm::uv_pipe_ptr OutputPipe; - bool Finished = false; Status ProcessStatus; + + void Finish(); }; const cmUVProcessChainBuilder* Builder = nullptr; @@ -64,18 +43,21 @@ struct cmUVProcessChain::InternalData cm::uv_loop_ptr Loop; - StreamData<std::istream> OutputStreamData; - StreamData<std::istream> ErrorStreamData; + StreamData InputStreamData; + StreamData OutputStreamData; + StreamData ErrorStreamData; + cm::uv_pipe_ptr TempOutputPipe; + cm::uv_pipe_ptr TempErrorPipe; unsigned int ProcessesCompleted = 0; std::vector<std::unique_ptr<ProcessData>> Processes; bool Prepare(const cmUVProcessChainBuilder* builder); - bool AddCommand(const cmUVProcessChainBuilder::ProcessConfiguration& config, - bool first, bool last); - bool Finish(); - - static const Status* GetStatus(const ProcessData& data); + void SpawnProcess( + std::size_t index, + const cmUVProcessChainBuilder::ProcessConfiguration& config, bool first, + bool last); + void Finish(); }; cmUVProcessChainBuilder::cmUVProcessChainBuilder() @@ -132,9 +114,6 @@ cmUVProcessChainBuilder& cmUVProcessChainBuilder::SetExternalStream( { switch (stdio) { case Stream_INPUT: - // FIXME - break; - case Stream_OUTPUT: case Stream_ERROR: { auto& streamData = this->Stdio[stdio]; @@ -167,11 +146,9 @@ cmUVProcessChain cmUVProcessChainBuilder::Start() const return chain; } - for (auto it = this->Processes.begin(); it != this->Processes.end(); ++it) { - if (!chain.Data->AddCommand(*it, it == this->Processes.begin(), - it == std::prev(this->Processes.end()))) { - return chain; - } + for (std::size_t i = 0; i < this->Processes.size(); i++) { + chain.Data->SpawnProcess(i, this->Processes[i], i == 0, + i == this->Processes.size() - 1); } chain.Data->Finish(); @@ -179,20 +156,30 @@ cmUVProcessChain cmUVProcessChainBuilder::Start() const return chain; } -const cmUVProcessChain::Status* cmUVProcessChain::InternalData::GetStatus( - const cmUVProcessChain::InternalData::ProcessData& data) -{ - if (data.Finished) { - return &data.ProcessStatus; - } - return nullptr; -} - bool cmUVProcessChain::InternalData::Prepare( const cmUVProcessChainBuilder* builder) { this->Builder = builder; + auto const& input = + this->Builder->Stdio[cmUVProcessChainBuilder::Stream_INPUT]; + auto& inputData = this->InputStreamData; + switch (input.Type) { + case cmUVProcessChainBuilder::None: + inputData.Stdio.flags = UV_IGNORE; + break; + + case cmUVProcessChainBuilder::Builtin: { + // FIXME + break; + } + + case cmUVProcessChainBuilder::External: + inputData.Stdio.flags = UV_INHERIT_FD; + inputData.Stdio.data.fd = input.FileDescriptor; + break; + } + auto const& error = this->Builder->Stdio[cmUVProcessChainBuilder::Stream_ERROR]; auto& errorData = this->ErrorStreamData; @@ -207,12 +194,17 @@ bool cmUVProcessChain::InternalData::Prepare( return false; } - errorData.BuiltinStream.init(*this->Loop, 0); - if (uv_pipe_open(errorData.BuiltinStream, pipeFd[0]) < 0) { - return false; - } + errorData.BuiltinStream = pipeFd[0]; errorData.Stdio.flags = UV_INHERIT_FD; errorData.Stdio.data.fd = pipeFd[1]; + + if (this->TempErrorPipe.init(*this->Loop, 0) < 0) { + return false; + } + if (uv_pipe_open(this->TempErrorPipe, errorData.Stdio.data.fd) < 0) { + return false; + } + break; } @@ -232,13 +224,25 @@ bool cmUVProcessChain::InternalData::Prepare( case cmUVProcessChainBuilder::Builtin: if (this->Builder->MergedBuiltinStreams) { + outputData.BuiltinStream = errorData.BuiltinStream; outputData.Stdio.flags = UV_INHERIT_FD; outputData.Stdio.data.fd = errorData.Stdio.data.fd; } else { - outputData.BuiltinStream.init(*this->Loop, 0); - outputData.Stdio.flags = - static_cast<uv_stdio_flags>(UV_CREATE_PIPE | UV_WRITABLE_PIPE); - outputData.Stdio.data.stream = outputData.BuiltinStream; + int pipeFd[2]; + if (cmGetPipes(pipeFd) < 0) { + return false; + } + + outputData.BuiltinStream = pipeFd[0]; + outputData.Stdio.flags = UV_INHERIT_FD; + outputData.Stdio.data.fd = pipeFd[1]; + + if (this->TempOutputPipe.init(*this->Loop, 0) < 0) { + return false; + } + if (uv_pipe_open(this->TempOutputPipe, outputData.Stdio.data.fd) < 0) { + return false; + } } break; @@ -248,16 +252,47 @@ bool cmUVProcessChain::InternalData::Prepare( break; } + bool first = true; + for (std::size_t i = 0; i < this->Builder->Processes.size(); i++) { + this->Processes.emplace_back(cm::make_unique<ProcessData>()); + auto& process = *this->Processes.back(); + process.Data = this; + process.ProcessStatus.Finished = false; + + if (!first) { + auto& prevProcess = *this->Processes[i - 1]; + + int pipeFd[2]; + if (cmGetPipes(pipeFd) < 0) { + return false; + } + + if (prevProcess.OutputPipe.init(*this->Loop, 0) < 0) { + return false; + } + if (uv_pipe_open(prevProcess.OutputPipe, pipeFd[1]) < 0) { + return false; + } + if (process.InputPipe.init(*this->Loop, 0) < 0) { + return false; + } + if (uv_pipe_open(process.InputPipe, pipeFd[0]) < 0) { + return false; + } + } + + first = false; + } + return true; } -bool cmUVProcessChain::InternalData::AddCommand( +void cmUVProcessChain::InternalData::SpawnProcess( + std::size_t index, const cmUVProcessChainBuilder::ProcessConfiguration& config, bool first, bool last) { - this->Processes.emplace_back(cm::make_unique<ProcessData>()); - auto& process = *this->Processes.back(); - process.Data = this; + auto& process = *this->Processes[index]; auto options = uv_process_options_t(); @@ -277,24 +312,18 @@ bool cmUVProcessChain::InternalData::AddCommand( } std::array<uv_stdio_container_t, 3> stdio; - stdio[0] = uv_stdio_container_t(); if (first) { - stdio[0].flags = UV_IGNORE; + stdio[0] = this->InputStreamData.Stdio; } else { - assert(this->Processes.size() >= 2); - auto& prev = *this->Processes[this->Processes.size() - 2]; + stdio[0] = uv_stdio_container_t(); stdio[0].flags = UV_INHERIT_STREAM; - stdio[0].data.stream = prev.OutputPipe; + stdio[0].data.stream = process.InputPipe; } if (last) { stdio[1] = this->OutputStreamData.Stdio; } else { - if (process.OutputPipe.init(*this->Loop, 0) < 0) { - return false; - } stdio[1] = uv_stdio_container_t(); - stdio[1].flags = - static_cast<uv_stdio_flags>(UV_CREATE_PIPE | UV_WRITABLE_PIPE); + stdio[1].flags = UV_INHERIT_STREAM; stdio[1].data.stream = process.OutputPipe; } stdio[2] = this->ErrorStreamData.Stdio; @@ -304,40 +333,24 @@ bool cmUVProcessChain::InternalData::AddCommand( options.exit_cb = [](uv_process_t* handle, int64_t exitStatus, int termSignal) { auto* processData = static_cast<ProcessData*>(handle->data); - processData->Finished = true; processData->ProcessStatus.ExitStatus = exitStatus; processData->ProcessStatus.TermSignal = termSignal; - processData->Data->ProcessesCompleted++; + processData->Finish(); }; - return process.Process.spawn(*this->Loop, options, &process) >= 0; + if ((process.ProcessStatus.SpawnResult = + process.Process.spawn(*this->Loop, options, &process)) < 0) { + process.Finish(); + } + process.InputPipe.reset(); + process.OutputPipe.reset(); } -bool cmUVProcessChain::InternalData::Finish() +void cmUVProcessChain::InternalData::Finish() { - if (this->Builder->Stdio[cmUVProcessChainBuilder::Stream_OUTPUT].Type == - cmUVProcessChainBuilder::Builtin && - !this->Builder->MergedBuiltinStreams) { - this->OutputStreamData.Streambuf.open( - this->OutputStreamData.BuiltinStream); - } - - if (this->Builder->Stdio[cmUVProcessChainBuilder::Stream_ERROR].Type == - cmUVProcessChainBuilder::Builtin) { - cm::uv_pipe_ptr tmpPipe; - if (tmpPipe.init(*this->Loop, 0) < 0) { - return false; - } - if (uv_pipe_open(tmpPipe, this->ErrorStreamData.Stdio.data.fd) < 0) { - return false; - } - tmpPipe.reset(); - - this->ErrorStreamData.Streambuf.open(this->ErrorStreamData.BuiltinStream); - } - + this->TempOutputPipe.reset(); + this->TempErrorPipe.reset(); this->Valid = true; - return true; } cmUVProcessChain::cmUVProcessChain() @@ -365,17 +378,14 @@ uv_loop_t& cmUVProcessChain::GetLoop() return *this->Data->Loop; } -std::istream* cmUVProcessChain::OutputStream() +int cmUVProcessChain::OutputStream() { - if (this->Data->Builder->MergedBuiltinStreams) { - return this->Data->ErrorStreamData.GetBuiltinStream(); - } - return this->Data->OutputStreamData.GetBuiltinStream(); + return this->Data->OutputStreamData.BuiltinStream; } -std::istream* cmUVProcessChain::ErrorStream() +int cmUVProcessChain::ErrorStream() { - return this->Data->ErrorStreamData.GetBuiltinStream(); + return this->Data->ErrorStreamData.BuiltinStream; } bool cmUVProcessChain::Valid() const @@ -412,19 +422,15 @@ std::vector<const cmUVProcessChain::Status*> cmUVProcessChain::GetStatus() std::vector<const cmUVProcessChain::Status*> statuses( this->Data->Processes.size(), nullptr); for (std::size_t i = 0; i < statuses.size(); i++) { - statuses[i] = this->GetStatus(i); + statuses[i] = &this->GetStatus(i); } return statuses; } -const cmUVProcessChain::Status* cmUVProcessChain::GetStatus( +const cmUVProcessChain::Status& cmUVProcessChain::GetStatus( std::size_t index) const { - auto const& process = *this->Data->Processes[index]; - if (process.Finished) { - return &process.ProcessStatus; - } - return nullptr; + return this->Data->Processes[index]->ProcessStatus; } bool cmUVProcessChain::Finished() const @@ -435,8 +441,12 @@ bool cmUVProcessChain::Finished() const std::pair<cmUVProcessChain::ExceptionCode, std::string> cmUVProcessChain::Status::GetException() const { + if (this->SpawnResult) { + return std::make_pair(ExceptionCode::Spawn, + uv_strerror(this->SpawnResult)); + } #ifdef _WIN32 - if ((this->ExitStatus & 0xF0000000) == 0xC0000000) { + if (this->Finished && (this->ExitStatus & 0xF0000000) == 0xC0000000) { // Child terminated due to exceptional behavior. switch (this->ExitStatus) { case STATUS_CONTROL_C_EXIT: @@ -511,9 +521,8 @@ cmUVProcessChain::Status::GetException() const } } } - return std::make_pair(ExceptionCode::None, ""); #else - if (this->TermSignal) { + if (this->Finished && this->TermSignal) { switch (this->TermSignal) { # ifdef SIGSEGV case SIGSEGV: @@ -670,6 +679,12 @@ cmUVProcessChain::Status::GetException() const } } } - return std::make_pair(ExceptionCode::None, ""); #endif + return std::make_pair(ExceptionCode::None, ""); +} + +void cmUVProcessChain::InternalData::ProcessData::Finish() +{ + this->ProcessStatus.Finished = true; + this->Data->ProcessesCompleted++; } diff --git a/Source/cmUVProcessChain.h b/Source/cmUVProcessChain.h index f92742f..d7a4a0e 100644 --- a/Source/cmUVProcessChain.h +++ b/Source/cmUVProcessChain.h @@ -5,7 +5,6 @@ #include <array> #include <cstddef> // IWYU pragma: keep #include <cstdint> -#include <iosfwd> #include <memory> #include <string> #include <utility> @@ -74,11 +73,14 @@ public: Illegal, Interrupt, Numerical, + Spawn, Other, }; struct Status { + int SpawnResult; + bool Finished; int64_t ExitStatus; int TermSignal; @@ -96,13 +98,13 @@ public: uv_loop_t& GetLoop(); // FIXME: Add stdin support - std::istream* OutputStream(); - std::istream* ErrorStream(); + int OutputStream(); + int ErrorStream(); bool Valid() const; bool Wait(int64_t milliseconds = -1); std::vector<const Status*> GetStatus() const; - const Status* GetStatus(std::size_t index) const; + const Status& GetStatus(std::size_t index) const; bool Finished() const; private: diff --git a/Source/cmUVStream.h b/Source/cmUVStream.h new file mode 100644 index 0000000..5998256 --- /dev/null +++ b/Source/cmUVStream.h @@ -0,0 +1,140 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#pragma once + +#include <cassert> +#include <istream> + +#include <cm3p/uv.h> + +#include "cmUVHandlePtr.h" +#include "cmUVStreambuf.h" + +template <typename CharT, typename Traits = std::char_traits<CharT>> +class cmBasicUVIStream : public std::basic_istream<CharT> +{ +public: + cmBasicUVIStream(); + cmBasicUVIStream(uv_stream_t* stream); + + bool is_open() const; + + void open(uv_stream_t* stream); + + void close(); + +private: + cmBasicUVStreambuf<CharT, Traits> Buffer; +}; + +template <typename CharT, typename Traits> +cmBasicUVIStream<CharT, Traits>::cmBasicUVIStream() + : std::basic_istream<CharT, Traits>(&this->Buffer) +{ +} + +template <typename CharT, typename Traits> +cmBasicUVIStream<CharT, Traits>::cmBasicUVIStream(uv_stream_t* stream) + : cmBasicUVIStream() +{ + this->open(stream); +} + +template <typename CharT, typename Traits> +bool cmBasicUVIStream<CharT, Traits>::is_open() const +{ + return this->Buffer.is_open(); +} + +template <typename CharT, typename Traits> +void cmBasicUVIStream<CharT, Traits>::open(uv_stream_t* stream) +{ + this->Buffer.open(stream); +} + +template <typename CharT, typename Traits> +void cmBasicUVIStream<CharT, Traits>::close() +{ + this->Buffer.close(); +} + +using cmUVIStream = cmBasicUVIStream<char>; + +template <typename CharT, typename Traits = std::char_traits<CharT>> +class cmBasicUVPipeIStream : public cmBasicUVIStream<CharT, Traits> +{ +public: + cmBasicUVPipeIStream(); + cmBasicUVPipeIStream(uv_loop_t& loop, int fd); + + using cmBasicUVIStream<CharT, Traits>::is_open; + + void open(uv_loop_t& loop, int fd); + + void close(); + +private: + cm::uv_pipe_ptr Pipe; +}; + +template <typename CharT, typename Traits> +cmBasicUVPipeIStream<CharT, Traits>::cmBasicUVPipeIStream() = default; + +template <typename CharT, typename Traits> +cmBasicUVPipeIStream<CharT, Traits>::cmBasicUVPipeIStream(uv_loop_t& loop, + int fd) +{ + this->open(loop, fd); +} + +template <typename CharT, typename Traits> +void cmBasicUVPipeIStream<CharT, Traits>::open(uv_loop_t& loop, int fd) +{ + this->Pipe.init(loop, 0); + uv_pipe_open(this->Pipe, fd); + this->cmBasicUVIStream<CharT, Traits>::open(this->Pipe); +} + +template <typename CharT, typename Traits> +void cmBasicUVPipeIStream<CharT, Traits>::close() +{ + this->cmBasicUVIStream<CharT, Traits>::close(); + this->Pipe.reset(); +} + +using cmUVPipeIStream = cmBasicUVPipeIStream<char>; + +template <typename ReadCallback, typename FinishCallback> +void cmUVStreamRead(uv_stream_t* stream, ReadCallback onRead, + FinishCallback onFinish) +{ + struct ReadData + { + std::vector<char> Buffer; + ReadCallback OnRead; + FinishCallback OnFinish; + }; + + stream->data = new ReadData{ {}, std::move(onRead), std::move(onFinish) }; + uv_read_start( + stream, + [](uv_handle_t* s, std::size_t suggestedSize, uv_buf_t* buffer) { + auto* data = static_cast<ReadData*>(s->data); + data->Buffer.resize(suggestedSize); + buffer->base = data->Buffer.data(); + buffer->len = suggestedSize; + }, + [](uv_stream_t* s, ssize_t nread, const uv_buf_t* buffer) { + auto* data = static_cast<ReadData*>(s->data); + if (nread > 0) { + (void)buffer; + assert(buffer->base == data->Buffer.data()); + data->Buffer.resize(nread); + data->OnRead(std::move(data->Buffer)); + } else if (nread < 0 /*|| nread == UV_EOF*/) { + data->OnFinish(); + uv_read_stop(s); + delete data; + } + }); +} diff --git a/Source/cmUVStreambuf.h b/Source/cmUVStreambuf.h index efe45de..4f7b209 100644 --- a/Source/cmUVStreambuf.h +++ b/Source/cmUVStreambuf.h @@ -14,7 +14,8 @@ /* * This file is based on example code from: * - * http://www.voidcn.com/article/p-vjnlygmc-gy.html + * https://web.archive.org/web/20170515211805/ + * http://www.mr-edd.co.uk/blog/beginners_guide_streambuf * * The example code was distributed under the following license: * diff --git a/Source/cmUuid.cxx b/Source/cmUuid.cxx index 6688668..5f5d3e4 100644 --- a/Source/cmUuid.cxx +++ b/Source/cmUuid.cxx @@ -104,20 +104,20 @@ std::string cmUuid::BinaryToString(const unsigned char* input) const size_t bytes = kUuidGroups[i]; for (size_t j = 0; j < bytes; ++j) { - unsigned char byte = input[inputIndex++]; - output += this->ByteToHex(byte); + unsigned char inputByte = input[inputIndex++]; + output += this->ByteToHex(inputByte); } } return output; } -std::string cmUuid::ByteToHex(unsigned char byte) const +std::string cmUuid::ByteToHex(unsigned char inputByte) const { std::string result(" "); for (int i = 0; i < 2; ++i) { - unsigned char rest = byte % 16; - byte /= 16; + unsigned char rest = inputByte % 16; + inputByte /= 16; char c = (rest < 0xA) ? static_cast<char>('0' + rest) : static_cast<char>('a' + (rest - 0xA)); result.at(1 - i) = c; diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 8d6b024..4af3ebc 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -2534,18 +2534,6 @@ void cmVisualStudio10TargetGenerator::WriteAllSources(Elem& e0) break; case cmGeneratorTarget::SourceKindExternalObject: tool = "Object"; - if (this->LocalGenerator->GetVersion() < - cmGlobalVisualStudioGenerator::VSVersion::VS11) { - // For VS == 10 we cannot use LinkObjects to avoid linking custom - // command outputs. If an object file is generated in this target, - // then vs10 will use it in the build, and we have to list it as - // None instead of Object. - std::vector<cmSourceFile*> const* d = - this->GeneratorTarget->GetSourceDepends(si.Source); - if (d && !d->empty()) { - tool = "None"; - } - } break; case cmGeneratorTarget::SourceKindExtra: this->WriteExtraSource(e1, si.Source, toolSettings); diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx index 6e98874..7e4503b 100644 --- a/Source/cmVisualStudioGeneratorOptions.cxx +++ b/Source/cmVisualStudioGeneratorOptions.cxx @@ -75,7 +75,6 @@ void cmVisualStudioGeneratorOptions::FixExceptionHandlingDefault() // the flag to disable exception handling. When the user does // remove the flag we need to override the IDE default of on. switch (this->Version) { - case cmGlobalVisualStudioGenerator::VSVersion::VS11: case cmGlobalVisualStudioGenerator::VSVersion::VS12: case cmGlobalVisualStudioGenerator::VSVersion::VS14: case cmGlobalVisualStudioGenerator::VSVersion::VS15: diff --git a/Source/cm_codecvt.cxx b/Source/cm_codecvt.cxx index 12877b8..7b3349b 100644 --- a/Source/cm_codecvt.cxx +++ b/Source/cm_codecvt.cxx @@ -13,19 +13,19 @@ # include "cm_utf8.h" #endif -codecvt::codecvt(Encoding e) +codecvt::codecvt(codecvt_Encoding e) #if defined(_WIN32) : m_codepage(0) #endif { switch (e) { - case codecvt::ConsoleOutput: + case codecvt_Encoding::ConsoleOutput: #if defined(_WIN32) m_noconv = false; m_codepage = GetConsoleOutputCP(); break; #endif - case codecvt::ANSI: + case codecvt_Encoding::ANSI: #if defined(_WIN32) m_noconv = false; m_codepage = CP_ACP; @@ -33,10 +33,10 @@ codecvt::codecvt(Encoding e) #endif // We don't know which ANSI encoding to use for other platforms than // Windows so we don't do any conversion there - case codecvt::UTF8: - case codecvt::UTF8_WITH_BOM: + case codecvt_Encoding::UTF8: + case codecvt_Encoding::UTF8_WITH_BOM: // Assume internal encoding is UTF-8 - case codecvt::None: + case codecvt_Encoding::None: // No encoding default: this->m_noconv = true; diff --git a/Source/cm_codecvt.hxx b/Source/cm_codecvt.hxx index f628de7..eb98e98 100644 --- a/Source/cm_codecvt.hxx +++ b/Source/cm_codecvt.hxx @@ -7,21 +7,14 @@ #include <cwchar> #include <locale> +#include "cm_codecvt_Encoding.hxx" + class codecvt : public std::codecvt<char, char, mbstate_t> { public: - enum Encoding - { - None, - UTF8, - UTF8_WITH_BOM, - ANSI, - ConsoleOutput, - }; - #ifndef CMAKE_BOOTSTRAP - codecvt(Encoding e); + codecvt(codecvt_Encoding e); protected: ~codecvt() override; diff --git a/Source/cm_codecvt_Encoding.hxx b/Source/cm_codecvt_Encoding.hxx new file mode 100644 index 0000000..b91ad8f --- /dev/null +++ b/Source/cm_codecvt_Encoding.hxx @@ -0,0 +1,12 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#pragma once + +enum class codecvt_Encoding +{ + None, + UTF8, + UTF8_WITH_BOM, + ANSI, + ConsoleOutput, +}; diff --git a/Source/cmake.cxx b/Source/cmake.cxx index f30d4d3..b8ebca5 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -94,7 +94,6 @@ # include "cmGlobalBorlandMakefileGenerator.h" # include "cmGlobalJOMMakefileGenerator.h" # include "cmGlobalNMakeMakefileGenerator.h" -# include "cmGlobalVisualStudio11Generator.h" # include "cmGlobalVisualStudio12Generator.h" # include "cmGlobalVisualStudio14Generator.h" # include "cmGlobalVisualStudio9Generator.h" @@ -2507,6 +2506,18 @@ int cmake::ActualConfigure() "Name of generator toolset.", cmStateEnums::INTERNAL); } + if (!this->State->GetInitializedCacheValue( + "CMAKE_CROSSCOMPILING_EMULATOR")) { + cm::optional<std::string> emulator = + cmSystemTools::GetEnvVar("CMAKE_CROSSCOMPILING_EMULATOR"); + if (emulator && !emulator->empty()) { + std::string message = + "Emulator to run executables and tests when cross compiling."; + this->AddCacheEntry("CMAKE_CROSSCOMPILING_EMULATOR", *emulator, message, + cmStateEnums::STRING); + } + } + // reset any system configuration information, except for when we are // InTryCompile. With TryCompile the system info is taken from the parent's // info to save time @@ -2605,7 +2616,6 @@ std::unique_ptr<cmGlobalGenerator> cmake::EvaluateDefaultGlobalGenerator() static VSVersionedGenerator const vsGenerators[] = { { "14.0", "Visual Studio 14 2015" }, // { "12.0", "Visual Studio 12 2013" }, // - { "11.0", "Visual Studio 11 2012" }, // { "9.0", "Visual Studio 9 2008" } }; static const char* const vsEntries[] = { @@ -2990,7 +3000,6 @@ void cmake::AddDefaultGenerators() cmGlobalVisualStudioVersionedGenerator::NewFactory15()); this->Generators.push_back(cmGlobalVisualStudio14Generator::NewFactory()); this->Generators.push_back(cmGlobalVisualStudio12Generator::NewFactory()); - this->Generators.push_back(cmGlobalVisualStudio11Generator::NewFactory()); this->Generators.push_back(cmGlobalVisualStudio9Generator::NewFactory()); this->Generators.push_back(cmGlobalBorlandMakefileGenerator::NewFactory()); this->Generators.push_back(cmGlobalNMakeMakefileGenerator::NewFactory()); @@ -3916,7 +3925,7 @@ std::function<int()> cmake::BuildWorkflowStep( return [builder]() -> int { auto chain = builder.Start(); chain.Wait(); - return static_cast<int>(chain.GetStatus().front()->ExitStatus); + return static_cast<int>(chain.GetStatus(0).ExitStatus); }; } #endif diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 0c8d8db..ce2479b 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -28,6 +28,7 @@ #include "cmSystemTools.h" #include "cmTransformDepfile.h" #include "cmUVProcessChain.h" +#include "cmUVStream.h" #include "cmUtils.hxx" #include "cmValue.h" #include "cmVersion.h" @@ -2008,7 +2009,7 @@ int cmcmd::RunPreprocessor(const std::vector<std::string>& command, .SetBuiltinStream(cmUVProcessChainBuilder::Stream_ERROR) .AddCommand(command); auto process = builder.Start(); - if (!process.Valid()) { + if (!process.Valid() || process.GetStatus(0).SpawnResult != 0) { std::cerr << "Failed to start preprocessor."; return 1; } @@ -2016,12 +2017,9 @@ int cmcmd::RunPreprocessor(const std::vector<std::string>& command, std::cerr << "Failed to wait for preprocessor"; return 1; } - auto status = process.GetStatus(); - if (!status[0] || status[0]->ExitStatus != 0) { - auto* errorStream = process.ErrorStream(); - if (errorStream) { - std::cerr << errorStream->rdbuf(); - } + if (process.GetStatus(0).ExitStatus != 0) { + cmUVPipeIStream errorStream(process.GetLoop(), process.ErrorStream()); + std::cerr << errorStream.rdbuf(); return 1; } @@ -2130,7 +2128,7 @@ int cmcmd::RunLLVMRC(std::vector<std::string> const& args) .AddCommand(resource_compile); auto process = builder.Start(); result = 0; - if (!process.Valid()) { + if (!process.Valid() || process.GetStatus(0).SpawnResult != 0) { std::cerr << "Failed to start resource compiler."; result = 1; } else { @@ -2144,12 +2142,9 @@ int cmcmd::RunLLVMRC(std::vector<std::string> const& args) if (result != 0) { return result; } - auto status = process.GetStatus(); - if (!status[0] || status[0]->ExitStatus != 0) { - auto* errorStream = process.ErrorStream(); - if (errorStream) { - std::cerr << errorStream->rdbuf(); - } + if (process.GetStatus(0).ExitStatus != 0) { + cmUVPipeIStream errorStream(process.GetLoop(), process.ErrorStream()); + std::cerr << errorStream.rdbuf(); return 1; } diff --git a/Tests/CMakeLib/CMakeLists.txt b/Tests/CMakeLib/CMakeLists.txt index 5c14de2..4454f49 100644 --- a/Tests/CMakeLib/CMakeLists.txt +++ b/Tests/CMakeLib/CMakeLists.txt @@ -31,6 +31,7 @@ set(CMakeLib_TESTS testCMExtAlgorithm.cxx testCMExtEnumSet.cxx testList.cxx + testCMakePath.cxx ) if(CMake_ENABLE_DEBUGGER) list(APPEND CMakeLib_TESTS @@ -63,10 +64,15 @@ if(WIN32) endif() configure_file(testXMLParser.h.in testXMLParser.h @ONLY) +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/testUVProcessChainInput.txt" "HELLO WORLD!") create_test_sourcelist(CMakeLib_TEST_SRCS CMakeLibTests.cxx ${CMakeLib_TESTS}) add_executable(CMakeLibTests ${CMakeLib_TEST_SRCS}) -target_link_libraries(CMakeLibTests CMakeLib CTestLib) +target_link_libraries(CMakeLibTests PRIVATE CTestLib CMakeLib) +if(CMake_BUILD_PCH) + target_precompile_headers(CMakeLibTests PRIVATE "<iostream>" "<cm3p/uv.h>") + target_compile_definitions(CMakeLibTests PRIVATE "NOMINMAX") +endif() set_property(TARGET CMakeLibTests PROPERTY C_CLANG_TIDY "") set_property(TARGET CMakeLibTests PROPERTY CXX_CLANG_TIDY "") diff --git a/Tests/CMakeLib/testCMakePath.cxx b/Tests/CMakeLib/testCMakePath.cxx new file mode 100644 index 0000000..aa17e50 --- /dev/null +++ b/Tests/CMakeLib/testCMakePath.cxx @@ -0,0 +1,441 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ + +#include "cmConfigure.h" // IWYU pragma: keep + +#include <iostream> +#include <string> +#include <utility> + +#include <cm/string_view> +#include <cmext/string_view> + +#include "cmCMakePath.h" + +namespace { + +void checkResult(bool success) +{ + if (!success) { + std::cout << " => failed"; + } + std::cout << std::endl; +} + +bool testConstructors() +{ + std::cout << "testConstructors()"; + + bool result = true; + + { + cmCMakePath path; + if (!path.String().empty() || path != cmCMakePath{}) { + result = false; + } + } + { + cmCMakePath path{ "aa/bb" }; + if (path.String() != "aa/bb") { + result = false; + } + } + { + std::string s{ "aa/bb" }; + cmCMakePath path{ s }; + if (path.String() != "aa/bb") { + result = false; + } + } + { + cmCMakePath path{ "aa/bb"_s }; + if (path.String() != "aa/bb") { + result = false; + } + } + { + cmCMakePath path1{ "aa/bb" }; + cmCMakePath path2("aa/bb"_s); + + if (path1 != path2) { + result = false; + } + if (path1.String() != "aa/bb") { + result = false; + } + if (path1.String() != path2.String()) { + result = false; + } + } + { + cmCMakePath path1{ "aa/bb" }; + cmCMakePath path2{ path1 }; + + if (path1 != path2) { + result = false; + } + if (path1.String() != "aa/bb") { + result = false; + } + if (path1.String() != path2.String()) { + result = false; + } + } + + checkResult(result); + + return result; +} + +bool testAssign() +{ + std::cout << "testAssign()"; + + bool result = true; + + { + cmCMakePath path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2 = path1; + if (path1 != path2) { + result = false; + } + if (path1.String() != "aa/bb") { + result = false; + } + if (path1.String() != path2.String()) { + result = false; + } + } + { + cmCMakePath path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2 = std::move(path1); + if (path2.String() != "aa/bb") { + result = false; + } + } + { + std::string path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2 = path1; + if (path2.String() != "aa/bb") { + result = false; + } + } + { + std::string path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2 = std::move(path1); + if (path2.String() != "aa/bb") { + result = false; + } + } + { + cm::string_view path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2 = path1; + if (path2.String() != "aa/bb") { + result = false; + } + } + { + char path1[] = "aa/bb"; + cmCMakePath path2{ "cc/dd" }; + + path2 = path1; + if (path2.String() != "aa/bb") { + result = false; + } + } + { + std::string path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2.Assign(path1); + if (path2.String() != path1) { + result = false; + } + } + { + std::string path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2.Assign(std::move(path1)); + if (path2.String() != "aa/bb") { + result = false; + } + } + { + cm::string_view path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2.Assign(path1); + if (path2.String() != path1) { + result = false; + } + } + { + char path1[] = "aa/bb"; + cmCMakePath path2{ "cc/dd" }; + + path2.Assign(path1); + if (path2.String() != path1) { + result = false; + } + } + + checkResult(result); + + return result; +} + +bool testConcat() +{ + std::cout << "testConcat()"; + + bool result = true; + + { + cmCMakePath path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2 += path1; + + if (path2.String() != "cc/ddaa/bb") { + result = false; + } + } + { + cmCMakePath path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2 += std::move(path1); + if (path2.String() != "cc/ddaa/bb") { + result = false; + } + } + { + std::string path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2 += path1; + if (path2.String() != "cc/ddaa/bb") { + result = false; + } + } + { + std::string path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2 += std::move(path1); + if (path2.String() != "cc/ddaa/bb") { + result = false; + } + } + { + cm::string_view path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2 += path1; + if (path2.String() != "cc/ddaa/bb") { + result = false; + } + } + { + char path1[] = "aa/bb"; + cmCMakePath path2{ "cc/dd" }; + + path2 += path1; + if (path2.String() != "cc/ddaa/bb") { + result = false; + } + } + { + cmCMakePath path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2.Concat(path1); + if (path2.String() != "cc/ddaa/bb") { + result = false; + } + } + { + std::string path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2.Concat(path1); + if (path2.String() != "cc/ddaa/bb") { + result = false; + } + } + { + std::string path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2.Concat(std::move(path1)); + if (path2.String() != "cc/ddaa/bb") { + result = false; + } + } + { + cm::string_view path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2.Concat(path1); + if (path2.String() != "cc/ddaa/bb") { + result = false; + } + } + { + char path1[] = "aa/bb"; + cmCMakePath path2{ "cc/dd" }; + + path2.Concat(path1); + if (path2.String() != "cc/ddaa/bb") { + result = false; + } + } + + checkResult(result); + + return result; +} + +bool testAppend() +{ + std::cout << "testAppend()"; + + bool result = true; + + { + cmCMakePath path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2 /= path1; + + if (path2.String() != "cc/dd/aa/bb") { + result = false; + } + } + { + cmCMakePath path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2 /= std::move(path1); + if (path2.String() != "cc/dd/aa/bb") { + result = false; + } + } + { + std::string path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2 /= path1; + if (path2.String() != "cc/dd/aa/bb") { + result = false; + } + } + { + std::string path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2 /= std::move(path1); + if (path2.String() != "cc/dd/aa/bb") { + result = false; + } + } + { + cm::string_view path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2 /= path1; + if (path2.String() != "cc/dd/aa/bb") { + result = false; + } + } + { + char path1[] = "aa/bb"; + cmCMakePath path2{ "cc/dd" }; + + path2 /= path1; + if (path2.String() != "cc/dd/aa/bb") { + result = false; + } + } + { + cmCMakePath path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2.Append(path1); + if (path2.String() != "cc/dd/aa/bb") { + result = false; + } + } + { + std::string path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2.Append(path1); + if (path2.String() != "cc/dd/aa/bb") { + result = false; + } + } + { + std::string path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2.Append(std::move(path1)); + if (path2.String() != "cc/dd/aa/bb") { + result = false; + } + } + { + cm::string_view path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2.Append(path1); + if (path2.String() != "cc/dd/aa/bb") { + result = false; + } + } + { + char path1[] = "aa/bb"; + cmCMakePath path2{ "cc/dd" }; + + path2.Append(path1); + if (path2.String() != "cc/dd/aa/bb") { + result = false; + } + } + + checkResult(result); + + return result; +} +} + +int testCMakePath(int /*unused*/, char* /*unused*/[]) +{ + int result = 0; + + if (!testConstructors()) { + result = 1; + } + if (!testAssign()) { + result = 1; + } + if (!testConcat()) { + result = 1; + } + if (!testAppend()) { + result = 1; + } + + return result; +} diff --git a/Tests/CMakeLib/testUVProcessChain.cxx b/Tests/CMakeLib/testUVProcessChain.cxx index 7027689..7630aa0 100644 --- a/Tests/CMakeLib/testUVProcessChain.cxx +++ b/Tests/CMakeLib/testUVProcessChain.cxx @@ -1,5 +1,6 @@ #include <algorithm> #include <csignal> +#include <cstdio> #include <functional> #include <iostream> #include <sstream> @@ -16,11 +17,11 @@ #include "cmStringAlgorithms.h" #include "cmUVHandlePtr.h" #include "cmUVProcessChain.h" +#include "cmUVStream.h" #include "cmUVStreambuf.h" struct ExpectedStatus { - bool Finished; bool MatchExitStatus; bool MatchTermSignal; cmUVProcessChain::Status Status; @@ -28,38 +29,6 @@ struct ExpectedStatus std::string ExceptionString; }; -static const std::vector<ExpectedStatus> status1 = { - { false, false, false, { 0, 0 }, cmUVProcessChain::ExceptionCode::None, "" }, - { false, false, false, { 0, 0 }, cmUVProcessChain::ExceptionCode::None, "" }, - { false, false, false, { 0, 0 }, cmUVProcessChain::ExceptionCode::None, "" }, -}; - -static const std::vector<ExpectedStatus> status2 = { - { true, true, true, { 0, 0 }, cmUVProcessChain::ExceptionCode::None, "" }, - { false, false, false, { 0, 0 }, cmUVProcessChain::ExceptionCode::None, "" }, - { false, false, false, { 0, 0 }, cmUVProcessChain::ExceptionCode::None, "" }, -}; - -static const std::vector<ExpectedStatus> status3 = { - { true, true, true, { 0, 0 }, cmUVProcessChain::ExceptionCode::None, "" }, - { true, true, true, { 1, 0 }, cmUVProcessChain::ExceptionCode::None, "" }, -#ifdef _WIN32 - { true, - true, - true, - { STATUS_ACCESS_VIOLATION, 0 }, - cmUVProcessChain::ExceptionCode::Fault, - "Access violation" }, -#else - { true, - false, - true, - { 0, SIGABRT }, - cmUVProcessChain::ExceptionCode::Other, - "Subprocess aborted" }, -#endif -}; - static const char* ExceptionCodeToString(cmUVProcessChain::ExceptionCode code) { switch (code) { @@ -73,6 +42,8 @@ static const char* ExceptionCodeToString(cmUVProcessChain::ExceptionCode code) return "Interrupt"; case cmUVProcessChain::ExceptionCode::Numerical: return "Numerical"; + case cmUVProcessChain::ExceptionCode::Spawn: + return "Spawn"; case cmUVProcessChain::ExceptionCode::Other: return "Other"; default: @@ -83,9 +54,10 @@ static const char* ExceptionCodeToString(cmUVProcessChain::ExceptionCode code) bool operator==(const cmUVProcessChain::Status* actual, const ExpectedStatus& expected) { - if (!expected.Finished) { - return !actual; - } else if (!actual) { + if (expected.Status.SpawnResult != actual->SpawnResult) { + return false; + } + if (expected.Status.Finished != actual->Finished) { return false; } if (expected.MatchExitStatus && @@ -96,7 +68,7 @@ bool operator==(const cmUVProcessChain::Status* actual, expected.Status.TermSignal != actual->TermSignal) { return false; } - if (expected.Finished && + if (expected.Status.Finished && std::make_pair(expected.ExceptionCode, expected.ExceptionString) != actual->GetException()) { return false; @@ -150,39 +122,96 @@ static void printResults( { std::cout << "Expected: " << std::endl; for (auto const& e : expected) { - if (e.Finished) { - std::cout << " ExitStatus: " - << printExpected(e.MatchExitStatus, e.Status.ExitStatus) - << ", TermSignal: " - << printExpected(e.MatchTermSignal, e.Status.TermSignal) - << ", ExceptionCode: " - << printExpected(e.Finished, - ExceptionCodeToString(e.ExceptionCode)) - << ", ExceptionString: \"" - << printExpected(e.Finished, e.ExceptionString) << '"' - << std::endl; - } else { - std::cout << " null" << std::endl; - } + std::cout << " SpawnResult: " << e.Status.SpawnResult + << ", Finished: " << e.Status.Finished << ", ExitStatus: " + << printExpected(e.MatchExitStatus, e.Status.ExitStatus) + << ", TermSignal: " + << printExpected(e.MatchTermSignal, e.Status.TermSignal) + << ", ExceptionCode: " + << printExpected(e.Status.Finished, + ExceptionCodeToString(e.ExceptionCode)) + << ", ExceptionString: \"" + << printExpected(e.Status.Finished, e.ExceptionString) << '"' + << std::endl; } std::cout << "Actual:" << std::endl; for (auto const& a : actual) { - if (a) { - auto exception = a->GetException(); - std::cout << " ExitStatus: " << a->ExitStatus - << ", TermSignal: " << a->TermSignal << ", ExceptionCode: " - << ExceptionCodeToString(exception.first) - << ", ExceptionString: \"" << exception.second << '"' - << std::endl; - } else { - std::cout << " null" << std::endl; - } + auto exception = a->GetException(); + std::cout << " SpawnResult: " << a->SpawnResult + << ", Finished: " << a->Finished + << ", ExitStatus: " << a->ExitStatus + << ", TermSignal: " << a->TermSignal + << ", ExceptionCode: " << ExceptionCodeToString(exception.first) + << ", ExceptionString: \"" << exception.second << '"' + << std::endl; } } static bool checkExecution(cmUVProcessChainBuilder& builder, std::unique_ptr<cmUVProcessChain>& chain) { + static const std::vector<ExpectedStatus> status1 = { + { false, + false, + { 0, false, 0, 0 }, + cmUVProcessChain::ExceptionCode::None, + "" }, + { false, + false, + { 0, false, 0, 0 }, + cmUVProcessChain::ExceptionCode::None, + "" }, + { false, + false, + { 0, false, 0, 0 }, + cmUVProcessChain::ExceptionCode::None, + "" }, + }; + + static const std::vector<ExpectedStatus> status2 = { + { true, + true, + { 0, true, 0, 0 }, + cmUVProcessChain::ExceptionCode::None, + "" }, + { false, + false, + { 0, false, 0, 0 }, + cmUVProcessChain::ExceptionCode::None, + "" }, + { false, + false, + { 0, false, 0, 0 }, + cmUVProcessChain::ExceptionCode::None, + "" }, + }; + + static const std::vector<ExpectedStatus> status3 = { + { true, + true, + { 0, true, 0, 0 }, + cmUVProcessChain::ExceptionCode::None, + "" }, + { true, + true, + { 0, true, 1, 0 }, + cmUVProcessChain::ExceptionCode::None, + "" }, +#ifdef _WIN32 + { true, + true, + { 0, true, STATUS_ACCESS_VIOLATION, 0 }, + cmUVProcessChain::ExceptionCode::Fault, + "Access violation" }, +#else + { false, + true, + { 0, true, 0, SIGABRT }, + cmUVProcessChain::ExceptionCode::Other, + "Subprocess aborted" }, +#endif + }; + std::vector<const cmUVProcessChain::Status*> status; chain = cm::make_unique<cmUVProcessChain>(builder.Start()); @@ -201,7 +230,7 @@ static bool checkExecution(cmUVProcessChainBuilder& builder, return false; } - if (chain->Wait(6000)) { + if (chain->Wait(9000)) { std::cout << "Wait() returned true, should be false" << std::endl; return false; } @@ -273,16 +302,19 @@ bool testUVProcessChainBuiltin(const char* helperCommand) return false; } - if (!chain->OutputStream()) { - std::cout << "OutputStream() was null, expecting not null" << std::endl; + if (chain->OutputStream() < 0) { + std::cout << "OutputStream() was invalid, expecting valid" << std::endl; return false; } - if (!chain->ErrorStream()) { - std::cout << "ErrorStream() was null, expecting not null" << std::endl; + if (chain->ErrorStream() < 0) { + std::cout << "ErrorStream() was invalid, expecting valid" << std::endl; return false; } - if (!checkOutput(*chain->OutputStream(), *chain->ErrorStream())) { + cmUVPipeIStream output(chain->GetLoop(), chain->OutputStream()); + cmUVPipeIStream error(chain->GetLoop(), chain->ErrorStream()); + + if (!checkOutput(output, error)) { return false; } @@ -302,12 +334,12 @@ bool testUVProcessChainBuiltinMerged(const char* helperCommand) return false; } - if (!chain->OutputStream()) { - std::cout << "OutputStream() was null, expecting not null" << std::endl; + if (chain->OutputStream() < 0) { + std::cout << "OutputStream() was invalid, expecting valid" << std::endl; return false; } - if (!chain->ErrorStream()) { - std::cout << "ErrorStream() was null, expecting not null" << std::endl; + if (chain->ErrorStream() < 0) { + std::cout << "ErrorStream() was invalid, expecting valid" << std::endl; return false; } if (chain->OutputStream() != chain->ErrorStream()) { @@ -316,7 +348,9 @@ bool testUVProcessChainBuiltinMerged(const char* helperCommand) return false; } - std::string merged = getInput(*chain->OutputStream()); + cmUVPipeIStream mergedStream(chain->GetLoop(), chain->OutputStream()); + + std::string merged = getInput(mergedStream); auto qemuErrorPos = merged.find("qemu:"); if (qemuErrorPos != std::string::npos) { merged.resize(qemuErrorPos); @@ -370,12 +404,12 @@ bool testUVProcessChainExternal(const char* helperCommand) return false; } - if (chain->OutputStream()) { - std::cout << "OutputStream() was not null, expecting null" << std::endl; + if (chain->OutputStream() >= 0) { + std::cout << "OutputStream() was valid, expecting invalid" << std::endl; return false; } - if (chain->ErrorStream()) { - std::cout << "ErrorStream() was not null, expecting null" << std::endl; + if (chain->ErrorStream() >= 0) { + std::cout << "ErrorStream() was valid, expecting invalid" << std::endl; return false; } @@ -418,12 +452,12 @@ bool testUVProcessChainNone(const char* helperCommand) return false; } - if (chain->OutputStream()) { - std::cout << "OutputStream() was not null, expecting null" << std::endl; + if (chain->OutputStream() >= 0) { + std::cout << "OutputStream() was valid, expecting invalid" << std::endl; return false; } - if (chain->ErrorStream()) { - std::cout << "ErrorStream() was not null, expecting null" << std::endl; + if (chain->ErrorStream() >= 0) { + std::cout << "ErrorStream() was valid, expecting invalid" << std::endl; return false; } @@ -445,7 +479,8 @@ bool testUVProcessChainCwdUnchanged(const char* helperCommand) return false; } - auto cwd = getInput(*chain.OutputStream()); + cmUVPipeIStream output(chain.GetLoop(), chain.OutputStream()); + auto cwd = getInput(output); if (!cmHasLiteralSuffix(cwd, "/Tests/CMakeLib")) { std::cout << "Working directory was \"" << cwd << "\", expected to end in \"/Tests/CMakeLib\"" << std::endl; @@ -471,7 +506,8 @@ bool testUVProcessChainCwdChanged(const char* helperCommand) return false; } - auto cwd = getInput(*chain.OutputStream()); + cmUVPipeIStream output(chain.GetLoop(), chain.OutputStream()); + auto cwd = getInput(output); if (!cmHasLiteralSuffix(cwd, "/Tests")) { std::cout << "Working directory was \"" << cwd << "\", expected to end in \"/Tests\"" << std::endl; @@ -481,6 +517,141 @@ bool testUVProcessChainCwdChanged(const char* helperCommand) return true; } +bool testUVProcessChainSpawnFail(const char* helperCommand) +{ + static const std::vector<ExpectedStatus> status1 = { + { false, + false, + { 0, false, 0, 0 }, + cmUVProcessChain::ExceptionCode::None, + "" }, + { false, + false, + { UV_ENOENT, true, 0, 0 }, + cmUVProcessChain::ExceptionCode::Spawn, + uv_strerror(UV_ENOENT) }, +#ifdef _WIN32 + { true, + true, + { 0, true, STATUS_ACCESS_VIOLATION, 0 }, + cmUVProcessChain::ExceptionCode::Fault, + "Access violation" }, +#else + { false, + true, + { 0, true, 0, SIGABRT }, + cmUVProcessChain::ExceptionCode::Other, + "Subprocess aborted" }, +#endif + }; + + static const std::vector<ExpectedStatus> status2 = { +#ifdef _WIN32 + { true, + true, + { 0, true, 0, 0 }, + cmUVProcessChain::ExceptionCode::None, + "" }, +#else + { false, + true, + { 0, true, 0, SIGPIPE }, + cmUVProcessChain::ExceptionCode::Other, + "SIGPIPE" }, +#endif + { false, + false, + { UV_ENOENT, true, 0, 0 }, + cmUVProcessChain::ExceptionCode::Spawn, + uv_strerror(UV_ENOENT) }, +#ifdef _WIN32 + { true, + true, + { 0, true, STATUS_ACCESS_VIOLATION, 0 }, + cmUVProcessChain::ExceptionCode::Fault, + "Access violation" }, +#else + { false, + true, + { 0, true, 0, SIGABRT }, + cmUVProcessChain::ExceptionCode::Other, + "Subprocess aborted" }, +#endif + }; + + std::vector<const cmUVProcessChain::Status*> status; + + cmUVProcessChainBuilder builder; + builder.AddCommand({ helperCommand, "echo" }) + .AddCommand({ "this_command_is_for_cmake_and_should_never_exist" }) + .AddCommand({ helperCommand, "dedup" }) + .SetBuiltinStream(cmUVProcessChainBuilder::Stream_OUTPUT) + .SetBuiltinStream(cmUVProcessChainBuilder::Stream_ERROR); + + auto chain = builder.Start(); + if (!chain.Valid()) { + std::cout << "Valid() returned false, should be true" << std::endl; + return false; + } + + // Some platforms, like Solaris 10, take a long time to report a trapped + // subprocess to the parent process (about 1.7 seconds in the case of + // Solaris 10.) Wait 3 seconds to give it enough time. + if (chain.Wait(3000)) { + std::cout << "Wait() did not time out" << std::endl; + return false; + } + + status = chain.GetStatus(); + if (!resultsMatch(status, status1)) { + std::cout << "GetStatus() did not produce expected output" << std::endl; + printResults(status, status1); + return false; + } + + if (!chain.Wait()) { + std::cout << "Wait() timed out" << std::endl; + return false; + } + + status = chain.GetStatus(); + if (!resultsMatch(status, status2)) { + std::cout << "GetStatus() did not produce expected output" << std::endl; + printResults(status, status2); + return false; + } + + return true; +} + +bool testUVProcessChainInputFile(const char* helperCommand) +{ + std::unique_ptr<FILE, int (*)(FILE*)> f( + fopen("testUVProcessChainInput.txt", "rb"), fclose); + + cmUVProcessChainBuilder builder; + builder.AddCommand({ helperCommand, "dedup" }) + .SetExternalStream(cmUVProcessChainBuilder::Stream_INPUT, fileno(f.get())) + .SetBuiltinStream(cmUVProcessChainBuilder::Stream_OUTPUT); + + auto chain = builder.Start(); + + if (!chain.Wait()) { + std::cout << "Wait() timed out" << std::endl; + return false; + } + + cmUVPipeIStream stream(chain.GetLoop(), chain.OutputStream()); + std::string output = getInput(stream); + if (output != "HELO WRD!") { + std::cout << "Output was \"" << output << "\", expected \"HELO WRD!\"" + << std::endl; + return false; + } + + return true; +} + int testUVProcessChain(int argc, char** const argv) { if (argc < 2) { @@ -518,5 +689,15 @@ int testUVProcessChain(int argc, char** const argv) return -1; } + if (!testUVProcessChainSpawnFail(argv[1])) { + std::cout << "While executing testUVProcessChainSpawnFail().\n"; + return -1; + } + + if (!testUVProcessChainInputFile(argv[1])) { + std::cout << "While executing testUVProcessChainInputFile().\n"; + return -1; + } + return 0; } diff --git a/Tests/CMakeLib/testUVProcessChainHelper.cxx b/Tests/CMakeLib/testUVProcessChainHelper.cxx index 99743e7..fcc45b0 100644 --- a/Tests/CMakeLib/testUVProcessChainHelper.cxx +++ b/Tests/CMakeLib/testUVProcessChainHelper.cxx @@ -32,13 +32,13 @@ int main(int argc, char** argv) std::string command = argv[1]; if (command == "echo") { - std::this_thread::sleep_for(std::chrono::milliseconds(3000)); + std::this_thread::sleep_for(std::chrono::milliseconds(6000)); std::cout << "HELLO world!" << std::flush; std::cerr << "1" << std::flush; return 0; } if (command == "capitalize") { - std::this_thread::sleep_for(std::chrono::milliseconds(9000)); + std::this_thread::sleep_for(std::chrono::milliseconds(12000)); std::string input = getStdin(); for (auto& c : input) { c = static_cast<char>(std::toupper(c)); diff --git a/Tests/CMakeLib/testUVStreambuf.cxx b/Tests/CMakeLib/testUVStreambuf.cxx index f9ed6af..f3977d4 100644 --- a/Tests/CMakeLib/testUVStreambuf.cxx +++ b/Tests/CMakeLib/testUVStreambuf.cxx @@ -3,11 +3,14 @@ #include <string> #include <vector> +#include <cmext/algorithm> + #include <cm3p/uv.h> #include <stdint.h> #include "cmGetPipes.h" #include "cmUVHandlePtr.h" +#include "cmUVStream.h" #include "cmUVStreambuf.h" #define TEST_STR_LINE_1 "This string must be exactly 128 characters long so" @@ -437,6 +440,90 @@ end: return success; } +bool testUVPipeIStream() +{ + int pipe[] = { -1, -1 }; + if (cmGetPipes(pipe) < 0) { + std::cout << "cmGetPipes() returned an error" << std::endl; + return false; + } + + cm::uv_loop_ptr loop; + loop.init(); + cm::uv_pipe_ptr pipeSink; + pipeSink.init(*loop, 0); + uv_pipe_open(pipeSink, pipe[1]); + + std::string str = "Hello world!\n"; + uv_write_t writeReq; + uv_buf_t buf; + buf.base = &str.front(); + buf.len = str.length(); + uv_write(&writeReq, pipeSink, &buf, 1, nullptr); + uv_run(loop, UV_RUN_DEFAULT); + + cmUVPipeIStream pin(*loop, pipe[0]); + std::string line; + std::getline(pin, line); + if (line != "Hello world!") { + std::cout << "Line was \"" << line << "\", should be \"Hello world!\"" + << std::endl; + return false; + } + + return true; +} + +bool testUVStreamRead() +{ + int pipe[] = { -1, -1 }; + if (cmGetPipes(pipe) < 0) { + std::cout << "cmGetPipes() returned an error" << std::endl; + return false; + } + + cm::uv_loop_ptr loop; + loop.init(); + cm::uv_pipe_ptr pipeSink; + pipeSink.init(*loop, 0); + uv_pipe_open(pipeSink, pipe[1]); + + std::string str = "Hello world!"; + uv_write_t writeReq; + uv_buf_t buf; + buf.base = &str.front(); + buf.len = str.length(); + uv_write(&writeReq, pipeSink, &buf, 1, nullptr); + uv_run(loop, UV_RUN_DEFAULT); + pipeSink.reset(); + + cm::uv_pipe_ptr pipeSource; + pipeSource.init(*loop, 0); + uv_pipe_open(pipeSource, pipe[0]); + + std::string output; + bool finished = false; + cmUVStreamRead( + pipeSource, + [&output](std::vector<char> data) { cm::append(output, data); }, + [&output, &finished]() { + if (output != "Hello world!") { + std::cout << "Output was \"" << output + << "\", should be \"Hello world!\"" << std::endl; + return; + } + finished = true; + }); + uv_run(loop, UV_RUN_DEFAULT); + + if (!finished) { + std::cout << "finished was not set" << std::endl; + return false; + } + + return true; +} + int testUVStreambuf(int argc, char** const argv) { if (argc < 2) { @@ -454,5 +541,15 @@ int testUVStreambuf(int argc, char** const argv) return -1; } + if (!testUVPipeIStream()) { + std::cout << "While executing testUVPipeIStream().\n"; + return -1; + } + + if (!testUVStreamRead()) { + std::cout << "While executing testUVPipeIStream().\n"; + return -1; + } + return 0; } diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 53bb1e6..f5ce6d9 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -42,8 +42,8 @@ endif() # Suppress generator deprecation warnings in test suite. if(CMAKE_GENERATOR MATCHES "^Visual Studio 9 2008") set(TEST_WARN_VS_CODE "set(ENV{CMAKE_WARN_VS9} OFF)") -elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 11 2012") - set(TEST_WARN_VS_CODE "set(ENV{CMAKE_WARN_VS11} OFF)") +elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 12 2013") + set(TEST_WARN_VS_CODE "set(ENV{CMAKE_WARN_VS12} OFF)") else() set(TEST_WARN_VS_CODE "") endif() @@ -1540,10 +1540,40 @@ if(BUILD_TESTING) add_subdirectory(GoogleTest) endif() - if(CMake_TEST_FindPython OR CMake_TEST_FindPython_SABIModule OR CMake_TEST_FindPython_NumPy - OR CMake_TEST_FindPython_Conda OR CMake_TEST_FindPython_IronPython OR CMake_TEST_FindPython_PyPy) - if (CMake_TEST_FindPython AND CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin") - set(CMake_TEST_FindPython_SABIModule TRUE) + if(CMake_TEST_FindPython) + set(CMake_TEST_FindPython2 TRUE) + set(CMake_TEST_FindPython3 TRUE) + endif() + if(CMake_TEST_FindPython_SABIMOdule) + set(CMake_TEST_FindPython2_SABIModule TRUE) + set(CMake_TEST_FindPython3_SABIModule TRUE) + endif() + if(CMake_TEST_FindPython_NumPy) + set(CMake_TEST_FindPython2_NumPyy TRUE) + set(CMake_TEST_FindPython3_NumPy TRUE) + endif() + if(CMake_TEST_FindPython_Conda) + set(CMake_TEST_FindPython3_Conda TRUE) + endif() + if(CMake_TEST_FindPython_IronPython) + set(CMake_TEST_FindPython2_IronPython TRUE) + set(CMake_TEST_FindPython3_IronPython TRUE) + endif() + if(CMake_TEST_FindPython_PyPy) + set(CMake_TEST_FindPython2_PyPy TRUE) + set(CMake_TEST_FindPython3_PyPy TRUE) + endif() + if(CMake_TEST_FindPython2 OR CMake_TEST_FindPython3 + OR CMake_TEST_FindPython2_SABIModule OR CMake_TEST_FindPython3_SABIModule + OR CMake_TEST_FindPython2_NumPy OR CMake_TEST_FindPython3_NumPy + OR CMake_TEST_FindPython3_Conda + OR CMake_TEST_FindPython2_IronPython OR CMake_TEST_FindPython3_IronPython + OR CMake_TEST_FindPython2_PyPy OR CMake_TEST_FindPython3_PyPy) + if (CMake_TEST_FindPython2 AND CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin") + set(CMake_TEST_FindPython2_SABIModule TRUE) + endif() + if (CMake_TEST_FindPython3 AND CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin") + set(CMake_TEST_FindPython3_SABIModule TRUE) endif() add_subdirectory(FindPython) endif() @@ -2279,11 +2309,6 @@ if(BUILD_TESTING) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSWinStorePhone/${name}") endmacro() - if(vs11 AND ws80) - add_test_VSWinStorePhone(vs11-store80-X86 "Visual Studio 11 2012" WindowsStore 8.0 Win32) - add_test_VSWinStorePhone(vs11-store80-ARM "Visual Studio 11 2012" WindowsStore 8.0 ARM) - add_test_VSWinStorePhone(vs11-store80-X64 "Visual Studio 11 2012" WindowsStore 8.0 x64) - endif() if(vs12 AND ws81) add_test_VSWinStorePhone(vs12-store81-X86 "Visual Studio 12 2013" WindowsStore 8.1 Win32) add_test_VSWinStorePhone(vs12-store81-ARM "Visual Studio 12 2013" WindowsStore 8.1 ARM) @@ -2311,10 +2336,6 @@ if(BUILD_TESTING) add_test_VSWinStorePhone(vs14-store10_0-ARM "Visual Studio 14 2015" WindowsStore 10.0 ARM) add_test_VSWinStorePhone(vs14-store10_0-X64 "Visual Studio 14 2015" WindowsStore 10.0 x64) endif() - if(vs11 AND wp80) - add_test_VSWinStorePhone(vs11-phone80-X86 "Visual Studio 11 2012" WindowsPhone 8.0 Win32) - add_test_VSWinStorePhone(vs11-phone80-ARM "Visual Studio 11 2012" WindowsPhone 8.0 ARM) - endif() if(vs12 AND wp81) add_test_VSWinStorePhone(vs12-phone81-X86 "Visual Studio 12 2013" WindowsPhone 8.1 Win32) add_test_VSWinStorePhone(vs12-phone81-ARM "Visual Studio 12 2013" WindowsPhone 8.1 ARM) @@ -2341,10 +2362,6 @@ if(BUILD_TESTING) endforeach() endmacro() - if(vs11) - add_test_VSWinCE(vs11-ce80-ARM "Visual Studio 11 2012" WindowsCE 8.0 ${wince_sdk}) - endif() - if(vs12) add_test_VSWinCE(vs12-ce80-ARM "Visual Studio 12 2013" WindowsCE 8.0 ${wince_sdk}) endif() @@ -2471,9 +2488,6 @@ if(BUILD_TESTING) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSAndroid/${name}") endmacro() if(tegra AND NOT "${CMake_SOURCE_DIR};${CMake_BINARY_DIR}" MATCHES " ") - if(vs11) - add_test_VSAndroid(vs11 "Visual Studio 11 2012" "Tegra-Android") - endif() if(vs12) add_test_VSAndroid(vs12 "Visual Studio 12 2013" "Tegra-Android") endif() @@ -3290,7 +3304,7 @@ if(BUILD_TESTING) "${CMake_BINARY_DIR}/Tests/CTestTestChecksum/testOutput.log" ) set_tests_properties(CTestTestChecksum PROPERTIES PASS_REGULAR_EXPRESSION - "Submission failed: Checksum failed for file") + "md5 mismatch") # these tests take a long time, make sure they have it # if timeouts have not already been set diff --git a/Tests/CMakeOnly/CheckCXXCompilerFlag/CMakeLists.txt b/Tests/CMakeOnly/CheckCXXCompilerFlag/CMakeLists.txt index e6ed559..0f3bd4c 100644 --- a/Tests/CMakeOnly/CheckCXXCompilerFlag/CMakeLists.txt +++ b/Tests/CMakeOnly/CheckCXXCompilerFlag/CMakeLists.txt @@ -20,7 +20,7 @@ macro(TEST_PASS value msg) endmacro() if(CMAKE_COMPILER_IS_GNUCXX) - exec_program(${CMAKE_C_COMPILER} ARGS --version OUTPUT_VARIABLE _gcc_version_info) + execute_process(COMMAND ${CMAKE_C_COMPILER} --version OUTPUT_VARIABLE _gcc_version_info) string (REGEX MATCH "[345]\\.[0-9]\\.[0-9]" _gcc_version "${_gcc_version_info}") # gcc on mac just reports: "gcc (GCC) 3.3 20030304 ..." without the # patch level, handle this here: @@ -30,12 +30,12 @@ if(CMAKE_COMPILER_IS_GNUCXX) endif() if(CMAKE_CXX_COMPILER_ID MATCHES Clang) - exec_program(${CMAKE_CXX_COMPILER} ARGS --version OUTPUT_VARIABLE _clang_version_info) + execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version OUTPUT_VARIABLE _clang_version_info) string (REGEX REPLACE ".*version ([0-9]\\.[0-9]).*" "\\1" _clang_version "${_clang_version_info}") endif() if(CMAKE_CXX_COMPILER_ID MATCHES Intel) - exec_program(${CMAKE_CXX_COMPILER} ARGS -V OUTPUT_VARIABLE _intel_version_info) + execute_process(COMMAND ${CMAKE_CXX_COMPILER} -V OUTPUT_VARIABLE _intel_version_info) string (REGEX REPLACE ".*Version ([0-9]+(\\.[0-9]+)+).*" "\\1" _intel_version "${_intel_version_info}") endif() diff --git a/Tests/CommandLineTest/CMakeLists.txt b/Tests/CommandLineTest/CMakeLists.txt index 96aac10..a44fb39 100644 --- a/Tests/CommandLineTest/CMakeLists.txt +++ b/Tests/CommandLineTest/CMakeLists.txt @@ -2,58 +2,58 @@ cmake_minimum_required (VERSION 2.6) project(CommandLineTest) get_filename_component(CMAKE_BIN_DIR ${CMAKE_COMMAND} PATH) -macro(EXEC_CMAKE_COMMAND CMAKE_ARGS) - exec_program("${CMAKE_COMMAND}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET) +macro(EXEC_CMAKE_COMMAND) + execute_process(COMMAND "${CMAKE_COMMAND}" ${ARGN} RESULT_VARIABLE RET) if(${RET}) - message(SEND_ERROR "CMake command failed with arguments \"${CMAKE_ARGS}\"") + message(SEND_ERROR "CMake command failed with arguments \"${ARGN}\"") endif() endmacro() -EXEC_CMAKE_COMMAND("-E chdir \"${CMAKE_CURRENT_SOURCE_DIR}\" \"${CMAKE_COMMAND}\" -E echo \"Hello World\"") -EXEC_CMAKE_COMMAND("-E time \"${CMAKE_COMMAND} -N -L ${CommandLineTest_SOURCE_DIR}\"") -EXEC_CMAKE_COMMAND("-E time \"${CMAKE_COMMAND} -N -LA ${CommandLineTest_SOURCE_DIR}\"") -EXEC_CMAKE_COMMAND("-E time \"${CMAKE_COMMAND} -N -LH ${CommandLineTest_SOURCE_DIR}\"") -EXEC_CMAKE_COMMAND("-E time \"${CMAKE_COMMAND} -N -LAH ${CommandLineTest_SOURCE_DIR}\"") -EXEC_CMAKE_COMMAND("--help") -EXEC_CMAKE_COMMAND("--help-command-list") -EXEC_CMAKE_COMMAND("--help add_executable") -EXEC_CMAKE_COMMAND("--help-command add_executable") -EXEC_CMAKE_COMMAND("--help-full \"${CMAKE_CURRENT_BINARY_DIR}/cmake.txt\"") -EXEC_CMAKE_COMMAND("--help-man \"${CMAKE_CURRENT_BINARY_DIR}/cmake.man\"") -EXEC_CMAKE_COMMAND("--help-html \"${CMAKE_CURRENT_BINARY_DIR}/cmake.html\"") -EXEC_CMAKE_COMMAND("--copyright \"${CMAKE_CURRENT_BINARY_DIR}/Copyright.txt\"") -EXEC_CMAKE_COMMAND("--version \"${CMAKE_CURRENT_BINARY_DIR}/version.txt\"") +EXEC_CMAKE_COMMAND(-E chdir "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_COMMAND}" -E echo "Hello World") +EXEC_CMAKE_COMMAND(-E time "${CMAKE_COMMAND} -N -L ${CommandLineTest_SOURCE_DIR}") +EXEC_CMAKE_COMMAND(-E time "${CMAKE_COMMAND} -N -LA ${CommandLineTest_SOURCE_DIR}") +EXEC_CMAKE_COMMAND(-E time "${CMAKE_COMMAND} -N -LH ${CommandLineTest_SOURCE_DIR}") +EXEC_CMAKE_COMMAND(-E time "${CMAKE_COMMAND} -N -LAH ${CommandLineTest_SOURCE_DIR}") +EXEC_CMAKE_COMMAND(--help) +EXEC_CMAKE_COMMAND(--help-command-list) +EXEC_CMAKE_COMMAND(--help add_executable) +EXEC_CMAKE_COMMAND(--help-command add_executable) +EXEC_CMAKE_COMMAND(--help-full "${CMAKE_CURRENT_BINARY_DIR}/cmake.txt") +EXEC_CMAKE_COMMAND(--help-man "${CMAKE_CURRENT_BINARY_DIR}/cmake.man") +EXEC_CMAKE_COMMAND(--help-html "${CMAKE_CURRENT_BINARY_DIR}/cmake.html") +EXEC_CMAKE_COMMAND(--copyright "${CMAKE_CURRENT_BINARY_DIR}/Copyright.txt") +EXEC_CMAKE_COMMAND(--version "${CMAKE_CURRENT_BINARY_DIR}/version.txt") add_executable(CommandLineTest CommandLineTest.cxx) get_filename_component(CMAKE_COMMAND_PATH "${CMAKE_COMMAND}" PATH) set(CTEST_COMMAND "${CMAKE_COMMAND_PATH}/ctest") -macro(EXEC_CTEST_COMMAND CMAKE_ARGS) - exec_program("${CTEST_COMMAND}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET) +macro(EXEC_CTEST_COMMAND) + execute_process(COMMAND "${CTEST_COMMAND}" ${ARGN} RESULT_VARIABLE RET) if(${RET}) message(SEND_ERROR "CTest command failed with arguments \"${CMAKE_ARGS}\"") endif() endmacro() -macro(EXEC_CTEST_COMMAND_WITH_DIR DIR CMAKE_ARGS) - exec_program("${CTEST_COMMAND}" "${DIR}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET) +macro(EXEC_CTEST_COMMAND_WITH_DIR DIR) + execute_process(COMMAND "${CTEST_COMMAND}" ${ARGN} WORKING_DIRECTORY "${DIR}" RESULT_VARIABLE RET) if(${RET}) message(SEND_ERROR "CTest command failed with arguments \"${CMAKE_ARGS}\"") endif() endmacro() -EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." "-N") -EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." "-R complex -N") -EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." "-E Simple -N") -EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." "-E Simple -N") -EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." "-N -I -10") -EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." "-N -I 10-") -EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." "-N -I 3,4") -EXEC_CTEST_COMMAND("--help") -EXEC_CTEST_COMMAND("--copyright") -EXEC_CTEST_COMMAND("--help-full \"${CMAKE_CURRENT_BINARY_DIR}/ctest.txt\"") -EXEC_CTEST_COMMAND("--help-man \"${CMAKE_CURRENT_BINARY_DIR}/ctest.man\"") -EXEC_CTEST_COMMAND("--help-html \"${CMAKE_CURRENT_BINARY_DIR}/ctest.html\"") -EXEC_CTEST_COMMAND("--version") +EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." -N) +EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." -R complex -N) +EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." -E Simple -N) +EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." -E Simple -N) +EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." -N -I -10) +EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." -N -I 10-) +EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." -N -I 3,4) +EXEC_CTEST_COMMAND(--help) +EXEC_CTEST_COMMAND(--copyright) +EXEC_CTEST_COMMAND(--help-full "${CMAKE_CURRENT_BINARY_DIR}/ctest.txt") +EXEC_CTEST_COMMAND(--help-man "${CMAKE_CURRENT_BINARY_DIR}/ctest.man") +EXEC_CTEST_COMMAND(--help-html "${CMAKE_CURRENT_BINARY_DIR}/ctest.html") +EXEC_CTEST_COMMAND(--version) if(THIS_SHOULD_BE_SET) message(STATUS "***************************") diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt index 9493a2f..d3a184d 100644 --- a/Tests/Complex/CMakeLists.txt +++ b/Tests/Complex/CMakeLists.txt @@ -327,12 +327,12 @@ if (WIN32) ${Complex_SOURCE_DIR}/Library/dummy "${dir}/${file}" COPYONLY) - exec_program(${CMAKE_COMMAND} ARGS "-E write_regv \"${hkey}\" \"${dir}\"") + execute_process(COMMAND ${CMAKE_COMMAND} -E write_regv "${hkey}" "${dir}") find_path(REGISTRY_TEST_PATH ${file} "[${hkey}]" DOC "Registry_Test_Path") - exec_program(${CMAKE_COMMAND} ARGS "-E delete_regv \"${hkey}\"") - exec_program(${CMAKE_COMMAND} ARGS "-E rm -f \"${dir}/${file}\"") + execute_process(COMMAND ${CMAKE_COMMAND} -E delete_regv "${hkey}") + execute_process(COMMAND ${CMAKE_COMMAND} -E rm -f "${dir}/${file}") endif () endif () diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt index e4fdc68..dd996e1 100644 --- a/Tests/ComplexOneConfig/CMakeLists.txt +++ b/Tests/ComplexOneConfig/CMakeLists.txt @@ -284,12 +284,12 @@ if (WIN32) ${Complex_SOURCE_DIR}/Library/dummy "${dir}/${file}" COPYONLY) - exec_program(${CMAKE_COMMAND} ARGS "-E write_regv \"${hkey}\" \"${dir}\"") + execute_process(COMMAND ${CMAKE_COMMAND} -E write_regv "${hkey}" "${dir}") find_path(REGISTRY_TEST_PATH ${file} "[${hkey}]" DOC "Registry_Test_Path") - exec_program(${CMAKE_COMMAND} ARGS "-E delete_regv \"${hkey}\"") - exec_program(${CMAKE_COMMAND} ARGS "-E rm -f \"${dir}/${file}\"") + execute_process(COMMAND ${CMAKE_COMMAND} -E delete_regv "${hkey}") + execute_process(COMMAND ${CMAKE_COMMAND} -E rm -f "${dir}/${file}") endif () endif () diff --git a/Tests/Cuda/CMakeLists.txt b/Tests/Cuda/CMakeLists.txt index 0041b07..c737bcc 100644 --- a/Tests/Cuda/CMakeLists.txt +++ b/Tests/Cuda/CMakeLists.txt @@ -13,6 +13,7 @@ add_cuda_test_macro(Cuda.MixedStandardLevels4 MixedStandardLevels4) add_cuda_test_macro(Cuda.MixedStandardLevels5 MixedStandardLevels5) add_cuda_test_macro(Cuda.NotEnabled CudaNotEnabled) add_cuda_test_macro(Cuda.SeparableCompCXXOnly SeparableCompCXXOnly) +add_cuda_test_macro(Cuda.StubRPATH StubRPATH) add_cuda_test_macro(Cuda.Toolkit Toolkit) add_cuda_test_macro(Cuda.IncludePathNoToolkit IncludePathNoToolkit) add_cuda_test_macro(Cuda.SharedRuntimePlusToolkit SharedRuntimePlusToolkit) diff --git a/Tests/Cuda/StubRPATH/CMakeLists.txt b/Tests/Cuda/StubRPATH/CMakeLists.txt new file mode 100644 index 0000000..93643c5 --- /dev/null +++ b/Tests/Cuda/StubRPATH/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.18) +project(StubRPATH CXX) + +#Verify that linking to a stub library doesn't cause an `-rpath` entry + +# Needed for `CUDAToolkit_LIBRARY_SEARCH_DIRS` +find_package(CUDAToolkit REQUIRED) + +find_library(CUDA_DRIVER_STUB_LIBRARY + NAMES cuda + HINTS ${CUDAToolkit_LIBRARY_SEARCH_DIRS} + ENV CUDA_PATH + PATH_SUFFIXES lib64/stubs lib/x64/stubs lib/stubs stubs +) +add_library(imported_stub IMPORTED SHARED) +set_target_properties(imported_stub PROPERTIES IMPORTED_IMPLIB "${CUDA_DRIVER_STUB_LIBRARY}") +set_target_properties(imported_stub PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CUDAToolkit_INCLUDE_DIRS}") + +set(CMAKE_CXX_STANDARD 11) +add_executable(StubRPATH main.cxx) +target_link_libraries(StubRPATH PRIVATE imported_stub) diff --git a/Tests/Cuda/StubRPATH/main.cxx b/Tests/Cuda/StubRPATH/main.cxx new file mode 100644 index 0000000..877856e --- /dev/null +++ b/Tests/Cuda/StubRPATH/main.cxx @@ -0,0 +1,17 @@ + +#include <iostream> + +#include <cuda.h> + +int main(int argc, char** argv) +{ + int nDevices = 0; + cuInit(0); + auto err = cuDeviceGetCount(&nDevices); + if (err != CUDA_SUCCESS) { + std::cerr << "Failed to retrieve the number of CUDA enabled devices " + << err << std::endl; + return 1; + } + return 0; +} diff --git a/Tests/ExternalOBJ/CMakeLists.txt b/Tests/ExternalOBJ/CMakeLists.txt index 4ff75b8..141977c 100644 --- a/Tests/ExternalOBJ/CMakeLists.txt +++ b/Tests/ExternalOBJ/CMakeLists.txt @@ -3,7 +3,7 @@ project (ExternalOBJ) if(APPLE) # set _CMAKE_OSX_MACHINE to umame -m - exec_program(uname ARGS -m OUTPUT_VARIABLE _CMAKE_OSX_MACHINE) + execute_process(COMMAND uname -m OUTPUT_VARIABLE _CMAKE_OSX_MACHINE OUTPUT_STRIP_TRAILING_WHITESPACE) # check for Power PC and change to ppc if("${_CMAKE_OSX_MACHINE}" MATCHES "Power") set(_CMAKE_OSX_MACHINE ppc) diff --git a/Tests/ExternalOBJ/Object/CMakeLists.txt b/Tests/ExternalOBJ/Object/CMakeLists.txt index dbfe09e..a886da0 100644 --- a/Tests/ExternalOBJ/Object/CMakeLists.txt +++ b/Tests/ExternalOBJ/Object/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 2.6) project(Object) if(APPLE) # set _CMAKE_OSX_MACHINE to umame -m - exec_program(uname ARGS -m OUTPUT_VARIABLE _CMAKE_OSX_MACHINE) + execute_process(COMMAND uname -m OUTPUT_VARIABLE _CMAKE_OSX_MACHINE OUTPUT_STRIP_TRAILING_WHITESPACE) # check for Power PC and change to ppc if("${_CMAKE_OSX_MACHINE}" MATCHES "Power") set(_CMAKE_OSX_MACHINE ppc) diff --git a/Tests/FindPython/ArtifactsInteractive/CMakeLists.txt b/Tests/FindPython/ArtifactsInteractive/CMakeLists.txt index 99823a6..18f8fda 100644 --- a/Tests/FindPython/ArtifactsInteractive/CMakeLists.txt +++ b/Tests/FindPython/ArtifactsInteractive/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.5) project(TestArtifactsInteractive LANGUAGES C) set (components Interpreter Development) -if (CMake_TEST_FindPython_NumPy) +if (CMake_TEST_FindPython3_NumPy) list (APPEND components NumPy) endif() @@ -12,13 +12,13 @@ find_package(Python3 REQUIRED COMPONENTS ${components}) if (Python3_ARTIFACTS_INTERACTIVE) if (NOT DEFINED CACHE{Python3_EXECUTABLE} OR NOT DEFINED CACHE{Python3_LIBRARY} OR NOT DEFINED CACHE{Python3_INCLUDE_DIR} - OR (CMake_TEST_FindPython_NumPy AND NOT DEFINED CACHE{Python3_NumPy_INCLUDE_DIR})) + OR (CMake_TEST_FindPython3_NumPy AND NOT DEFINED CACHE{Python3_NumPy_INCLUDE_DIR})) message (FATAL_ERROR "Python3_ARTIFACTS_INTERACTIVE=ON Failed.") endif() else() if (DEFINED CACHE{Python3_EXECUTABLE} OR DEFINED CACHE{Python3_LIBRARY} OR DEFINED CACHE{Python3_INCLUDE_DIR} - OR (CMake_TEST_FindPython_NumPy AND DEFINED CACHE{Python3_NumPy_INCLUDE_DIR})) + OR (CMake_TEST_FindPython3_NumPy AND DEFINED CACHE{Python3_NumPy_INCLUDE_DIR})) message (FATAL_ERROR "Python3_ARTIFACTS_INTERACTIVE=OFF Failed.") endif() endif() diff --git a/Tests/FindPython/CMakeLists.txt b/Tests/FindPython/CMakeLists.txt index b6942c9..636a7b0 100644 --- a/Tests/FindPython/CMakeLists.txt +++ b/Tests/FindPython/CMakeLists.txt @@ -1,4 +1,4 @@ -if(CMake_TEST_FindPython) +if(CMake_TEST_FindPython2) add_test(NAME FindPython.Python2.LOCATION COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test @@ -44,6 +44,139 @@ if(CMake_TEST_FindPython) set_tests_properties(FindPython.Python2Fail PROPERTIES PASS_REGULAR_EXPRESSION "Could NOT find Python2 \\(missing: foobar\\)") + add_test(NAME FindPython.Python.V2.LOCATION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/Python" + "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.LOCATION" + ${build_generator_args} + --build-project TestPython + --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=LOCATION + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + add_test(NAME FindPython.Python.V2.VERSION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/Python" + "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.VERSION" + ${build_generator_args} + --build-project TestPython + --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=VERSION + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + + add_test(NAME FindPython.Python2.ExactVersion.LOCATION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion" + "${CMake_BINARY_DIR}/Tests/FindPython/Python2.ExactVersion.LOCATION" + ${build_generator_args} + --build-project TestExactVersion + --build-options ${build_options} -DPython_MAJOR_VERSION=2 + -DPython_REQUESTED_VERSION=2.1.2 + -DPython2_FIND_STRATEGY=LOCATION + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + add_test(NAME FindPython.Python2.ExactVersion.VERSION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion" + "${CMake_BINARY_DIR}/Tests/FindPython/Python2.ExactVersion.VERSION" + ${build_generator_args} + --build-project TestExactVersion + --build-options ${build_options} -DPython_MAJOR_VERSION=2 + -DPython_REQUESTED_VERSION=2.1.2 + -DPython2_FIND_STRATEGY=VERSION + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + + add_test(NAME FindPython.Python.V2.ExactVersion.LOCATION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion" + "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.ExactVersion.LOCATION" + ${build_generator_args} + --build-project TestExactVersion + --build-options ${build_options} -DPython_REQUESTED_VERSION=2.1.2 + -DPython_FIND_STRATEGY=LOCATION + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + add_test(NAME FindPython.Python.V2.ExactVersion.VERSION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion" + "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.ExactVersion.VERSION" + ${build_generator_args} + --build-project TestExactVersion + --build-options ${build_options} -DPython_REQUESTED_VERSION=2.1.2 + -DPython_FIND_STRATEGY=VERSION + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + + add_test(NAME FindPython.Python2.VersionRange.LOCATION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange" + "${CMake_BINARY_DIR}/Tests/FindPython/Python2.VersionRange.LOCATION" + ${build_generator_args} + --build-project TestVersionRange + --build-options ${build_options} -DPython=Python2 -DPython_REQUESTED_VERSION=2 + -DPython2_FIND_STRATEGY=LOCATION + ) + add_test(NAME FindPython.Python2.VersionRange.VERSION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange" + "${CMake_BINARY_DIR}/Tests/FindPython/Python2.VersionRange.VERSION" + ${build_generator_args} + --build-project TestVersionRange + --build-options ${build_options} -DPython=Python2 -DPython_REQUESTED_VERSION=2 + -DPython2_FIND_STRATEGY=VERSION + ) + add_test(NAME FindPython.Python.V2.VersionRange.LOCATION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange" + "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.VersionRange.LOCATION" + ${build_generator_args} + --build-project TestVersionRange + --build-options ${build_options} -DPython=Python -DPython_REQUESTED_VERSION=2 + -DPython_FIND_STRATEGY=LOCATION + ) + add_test(NAME FindPython.Python.V2.VersionRange.VERSION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange" + "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.VersionRange.VERSION" + ${build_generator_args} + --build-project TestVersionRange + --build-options ${build_options} -DPython=Python -DPython_REQUESTED_VERSION=2 + -DPython_FIND_STRATEGY=VERSION + ) + + add_test(NAME FindPython.Python2Embedded COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/Python2Embedded" + "${CMake_BINARY_DIR}/Tests/FindPython/Python2Embedded" + ${build_generator_args} + --build-project TestPython2Embedded + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + + set_property(TEST FindPython.Python2.LOCATION FindPython.Python2.VERSION + FindPython.Python2.Development.Module FindPython.Python2Fail + FindPython.Python.V2.LOCATION FindPython.Python.V2.VERSION + FindPython.Python2.ExactVersion.LOCATION FindPython.Python2.ExactVersion.VERSION + FindPython.Python.V2.ExactVersion.LOCATION FindPython.Python.V2.ExactVersion.VERSION + FindPython.Python2.VersionRange.LOCATION FindPython.Python2.VersionRange.VERSION + FindPython.Python.V2.VersionRange.LOCATION FindPython.Python.V2.VersionRange.VERSION + FindPython.Python2Embedded + APPEND PROPERTY LABELS Python2) +endif() + +if(CMake_TEST_FindPython3) add_test(NAME FindPython.Python3.LOCATION COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test @@ -89,46 +222,6 @@ if(CMake_TEST_FindPython) set_tests_properties(FindPython.Python3Fail PROPERTIES PASS_REGULAR_EXPRESSION "Could NOT find Python3 \\(missing: foobar\\)") - add_test(NAME FindPython.Python.LOCATION COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/Python" - "${CMake_BINARY_DIR}/Tests/FindPython/Python.LOCATION" - ${build_generator_args} - --build-project TestPython - --build-options ${build_options} -DPython_FIND_STRATEGY=LOCATION - --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> - ) - add_test(NAME FindPython.Python.VERSION COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/Python" - "${CMake_BINARY_DIR}/Tests/FindPython/Python.VERSION" - ${build_generator_args} - --build-project TestPython - --build-options ${build_options} -DPython_FIND_STRATEGY=VERSION - --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> - ) - add_test(NAME FindPython.Python.V2.LOCATION COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/Python" - "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.LOCATION" - ${build_generator_args} - --build-project TestPython - --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=LOCATION - --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> - ) - add_test(NAME FindPython.Python.V2.VERSION COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/Python" - "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.VERSION" - ${build_generator_args} - --build-project TestPython - --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=VERSION - --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> - ) add_test(NAME FindPython.Python.V3.LOCATION COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test @@ -150,30 +243,6 @@ if(CMake_TEST_FindPython) --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) - add_test(NAME FindPython.Python2.ExactVersion.LOCATION COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion" - "${CMake_BINARY_DIR}/Tests/FindPython/Python2.ExactVersion.LOCATION" - ${build_generator_args} - --build-project TestExactVersion - --build-options ${build_options} -DPython_MAJOR_VERSION=2 - -DPython_REQUESTED_VERSION=2.1.2 - -DPython2_FIND_STRATEGY=LOCATION - --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> - ) - add_test(NAME FindPython.Python2.ExactVersion.VERSION COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion" - "${CMake_BINARY_DIR}/Tests/FindPython/Python2.ExactVersion.VERSION" - ${build_generator_args} - --build-project TestExactVersion - --build-options ${build_options} -DPython_MAJOR_VERSION=2 - -DPython_REQUESTED_VERSION=2.1.2 - -DPython2_FIND_STRATEGY=VERSION - --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> - ) add_test(NAME FindPython.Python3.ExactVersion.LOCATION COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test @@ -198,28 +267,6 @@ if(CMake_TEST_FindPython) -DPython3_FIND_STRATEGY=VERSION --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) - add_test(NAME FindPython.Python.V2.ExactVersion.LOCATION COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion" - "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.ExactVersion.LOCATION" - ${build_generator_args} - --build-project TestExactVersion - --build-options ${build_options} -DPython_REQUESTED_VERSION=2.1.2 - -DPython_FIND_STRATEGY=LOCATION - --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> - ) - add_test(NAME FindPython.Python.V2.ExactVersion.VERSION COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion" - "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.ExactVersion.VERSION" - ${build_generator_args} - --build-project TestExactVersion - --build-options ${build_options} -DPython_REQUESTED_VERSION=2.1.2 - -DPython_FIND_STRATEGY=VERSION - --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> - ) add_test(NAME FindPython.Python.V3.ExactVersion.LOCATION COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test @@ -263,46 +310,6 @@ if(CMake_TEST_FindPython) --build-options ${build_options} -DPython=Python3 -DPython_REQUESTED_VERSION=3 -DPython3_FIND_STRATEGY=VERSION ) - add_test(NAME FindPython.Python2.VersionRange.LOCATION COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange" - "${CMake_BINARY_DIR}/Tests/FindPython/Python2.VersionRange.LOCATION" - ${build_generator_args} - --build-project TestVersionRange - --build-options ${build_options} -DPython=Python2 -DPython_REQUESTED_VERSION=2 - -DPython2_FIND_STRATEGY=LOCATION - ) - add_test(NAME FindPython.Python2.VersionRange.VERSION COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange" - "${CMake_BINARY_DIR}/Tests/FindPython/Python2.VersionRange.VERSION" - ${build_generator_args} - --build-project TestVersionRange - --build-options ${build_options} -DPython=Python2 -DPython_REQUESTED_VERSION=2 - -DPython2_FIND_STRATEGY=VERSION - ) - add_test(NAME FindPython.Python.V2.VersionRange.LOCATION COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange" - "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.VersionRange.LOCATION" - ${build_generator_args} - --build-project TestVersionRange - --build-options ${build_options} -DPython=Python -DPython_REQUESTED_VERSION=2 - -DPython_FIND_STRATEGY=LOCATION - ) - add_test(NAME FindPython.Python.V2.VersionRange.VERSION COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange" - "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.VersionRange.VERSION" - ${build_generator_args} - --build-project TestVersionRange - --build-options ${build_options} -DPython=Python -DPython_REQUESTED_VERSION=2 - -DPython_FIND_STRATEGY=VERSION - ) add_test(NAME FindPython.Python.V3.VersionRange.LOCATION COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test @@ -324,17 +331,6 @@ if(CMake_TEST_FindPython) -DPython_FIND_STRATEGY=VERSION ) - add_test(NAME FindPython.MultiplePackages COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/MultiplePackages" - "${CMake_BINARY_DIR}/Tests/FindPython/MultiplePackages" - ${build_generator_args} - --build-project TestMultiplePackages - --build-options ${build_options} - --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> - ) - add_test(NAME FindPython.VirtualEnv COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test @@ -346,16 +342,6 @@ if(CMake_TEST_FindPython) --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) - add_test(NAME FindPython.Python2Embedded COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/Python2Embedded" - "${CMake_BINARY_DIR}/Tests/FindPython/Python2Embedded" - ${build_generator_args} - --build-project TestPython2Embedded - --build-options ${build_options} - --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> - ) add_test(NAME FindPython.Python3Embedded COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test @@ -377,7 +363,7 @@ if(CMake_TEST_FindPython) --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}" "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}" "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}" - "-DCMake_TEST_FindPython_SABIModule=${CMake_TEST_FindPython_SABIModule}" + "-DCMake_TEST_FindPython3_SABIModule=${CMake_TEST_FindPython3_SABIModule}" --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) @@ -391,7 +377,7 @@ if(CMake_TEST_FindPython) --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}" "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}" "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}" - "-DCMake_TEST_FindPython_NumPy=${CMake_TEST_FindPython_NumPy}" + "-DCMake_TEST_FindPython3_NumPy=${CMake_TEST_FindPython3_NumPy}" "-DPython3_ARTIFACTS_INTERACTIVE=ON" --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) @@ -405,7 +391,7 @@ if(CMake_TEST_FindPython) --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}" "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}" "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}" - "-DCMake_TEST_FindPython_NumPy=${CMake_TEST_FindPython_NumPy}" + "-DCMake_TEST_FindPython3_NumPy=${CMake_TEST_FindPython3_NumPy}" "-DPython3_ARTIFACTS_INTERACTIVE=OFF" --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) @@ -420,7 +406,7 @@ if(CMake_TEST_FindPython) --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}" "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}" "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}" - "-DCMake_TEST_FindPython_NumPy=${CMake_TEST_FindPython_NumPy}" + "-DCMake_TEST_FindPython3_NumPy=${CMake_TEST_FindPython3_NumPy}" --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) @@ -437,6 +423,54 @@ if(CMake_TEST_FindPython) --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) + set_property(TEST FindPython.Python3.LOCATION FindPython.Python3.VERSION + FindPython.Python3.Development.Module FindPython.Python3Fail + FindPython.Python.V3.LOCATION FindPython.Python.V3.VERSION + FindPython.Python3.ExactVersion.LOCATION FindPython.Python3.ExactVersion.VERSION + FindPython.Python.V3.ExactVersion.LOCATION FindPython.Python.V3.ExactVersion.VERSION + FindPython.Python3.VersionRange.LOCATION FindPython.Python3.VersionRange.VERSION + FindPython.Python.V3.VersionRange.LOCATION FindPython.Python.V3.VersionRange.VERSION + FindPython.VirtualEnv FindPython.Python3Embedded FindPython.RequiredArtifacts + FindPython.ArtifactsInteractive.ON FindPython.ArtifactsInteractive.OFF + FindPython.CustomFailureMessage FindPython.DifferentComponents + APPEND PROPERTY LABELS Python3) + + if (CMAKE_SYSTEM_NAME STREQUAL "Linux") + add_test(NAME FindPython.UnversionedNames COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/UnversionedNames" + "${CMake_BINARY_DIR}/Tests/FindPython/UnversionedNames" + ${build_generator_args} + --build-project UnversionedNames + --build-options ${build_options} + ) + set_property(TEST FindPython.UnversionedNames APPEND PROPERTY LABELS Python3) + endif() +endif() + +if(CMake_TEST_FindPython2 OR CMake_TEST_FindPython3) + add_test(NAME FindPython.Python.LOCATION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/Python" + "${CMake_BINARY_DIR}/Tests/FindPython/Python.LOCATION" + ${build_generator_args} + --build-project TestPython + --build-options ${build_options} -DPython_FIND_STRATEGY=LOCATION + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + add_test(NAME FindPython.Python.VERSION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/Python" + "${CMake_BINARY_DIR}/Tests/FindPython/Python.VERSION" + ${build_generator_args} + --build-project TestPython + --build-options ${build_options} -DPython_FIND_STRATEGY=VERSION + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + if (CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin") add_test(NAME FindPython.Interpreter.SOABI COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> @@ -464,22 +498,28 @@ if(CMake_TEST_FindPython) "-DCMake_TEST_FindPython_COMPONENT=Development" --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) + + set_property(TEST FindPython.Interpreter.SOABI FindPython.Development.SOABI + APPEND PROPERTY LABELS Python2 Python3) endif() - if (CMAKE_SYSTEM_NAME STREQUAL "Linux") - add_test(NAME FindPython.UnversionedNames COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/UnversionedNames" - "${CMake_BINARY_DIR}/Tests/FindPython/UnversionedNames" - ${build_generator_args} - --build-project UnversionedNames - --build-options ${build_options} + add_test(NAME FindPython.MultiplePackages COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/MultiplePackages" + "${CMake_BINARY_DIR}/Tests/FindPython/MultiplePackages" + ${build_generator_args} + --build-project TestMultiplePackages + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) - endif() + + set_property(TEST FindPython.Python.LOCATION FindPython.Python.VERSION FindPython.MultiplePackages + APPEND PROPERTY LABELS Python2 Python3) endif() -if(CMake_TEST_FindPython_SABIModule) + +if(CMake_TEST_FindPython2_SABIModule) add_test(NAME FindPython.Python2.Development.SABIModule COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test @@ -490,9 +530,12 @@ if(CMake_TEST_FindPython_SABIModule) --build-options ${build_options} --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) - set_tests_properties(FindPython.Python2.Development.SABIModule PROPERTIES - PASS_REGULAR_EXPRESSION "Could NOT find Python2 \\(missing: .*Development\\.SABIModule") + set_tests_properties(FindPython.Python2.Development.SABIModule PROPERTIES + PASS_REGULAR_EXPRESSION "Could NOT find Python2 \\(missing: .*Development\\.SABIModule") + set_property(TEST FindPython.Python2.Development.SABIModule APPEND PROPERTY LABELS Python2) +endif() +if(CMake_TEST_FindPython3_SABIModule) # Use exclusively Release configuration because Debug is, on Windows with MSVC, # unusable with SABI: Python force link with debug version of full versioned library rather than # the stable ABI one. @@ -506,9 +549,10 @@ if(CMake_TEST_FindPython_SABIModule) --build-options ${build_options} --test-command ${CMAKE_CTEST_COMMAND} -V -C Release ) + set_property(TEST FindPython.Python3.Development.SABIModule APPEND PROPERTY LABELS Python3) endif() -if(CMake_TEST_FindPython_NumPy) +if(CMake_TEST_FindPython2_NumPy OR CMake_TEST_FindPython3_NumPy) add_test(NAME FindPython.NumPy COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test @@ -528,9 +572,11 @@ if(CMake_TEST_FindPython_NumPy) --build-project TestNumPyOnly --build-options ${build_options} ) + + set_property(TEST FindPython.NumPy FindPython.NumPyOnly APPEND PROPERTY LABELS Python2 Python3) endif() -if(CMake_TEST_FindPython_Conda) +if(CMake_TEST_FindPython3_Conda) add_test(NAME FindPython.VirtualEnvConda COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test @@ -541,73 +587,83 @@ if(CMake_TEST_FindPython_Conda) --build-options ${build_options} --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) + set_property(TEST FindPython.VirtualEnvConda APPEND PROPERTY LABELS Python3) endif() -if (CMake_TEST_FindPython AND CMake_TEST_FindPython_IronPython) - add_test(NAME FindPython.Implementation.CPython COMMAND +if (CMake_TEST_FindPython2 AND CMake_TEST_FindPython2_IronPython) + add_test(NAME FindPython.Implementation.CPython2 COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test "${CMake_SOURCE_DIR}/Tests/FindPython/Implementation" - "${CMake_BINARY_DIR}/Tests/FindPython/Implementation.CPython" + "${CMake_BINARY_DIR}/Tests/FindPython/Implementation.CPython2" ${build_generator_args} --build-project TestImplementationCPython --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_REQUESTED_IMPLEMENTATIONS=CPython --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) - add_test(NAME FindPython.Implementation.IronPython COMMAND + add_test(NAME FindPython.Implementation.IronPython2 COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test "${CMake_SOURCE_DIR}/Tests/FindPython/Implementation" - "${CMake_BINARY_DIR}/Tests/FindPython/Implementation.IronPython" + "${CMake_BINARY_DIR}/Tests/FindPython/Implementation.IronPython2" ${build_generator_args} --build-project TestImplementationIronPython --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_REQUESTED_IMPLEMENTATION=IronPython --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) + + set_property(TEST FindPython.Implementation.CPython2 FindPython.Implementation.IronPython2 + APPEND PROPERTY LABELS Python2) endif() -if(CMake_TEST_FindPython_IronPython) - add_test(NAME FindPython.IronPython2.LOCATION COMMAND +if (CMake_TEST_FindPython3 AND CMake_TEST_FindPython3_IronPython) + add_test(NAME FindPython.Implementation.CPython3 COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython2" - "${CMake_BINARY_DIR}/Tests/FindPython/IronPython2.LOCATION" + "${CMake_SOURCE_DIR}/Tests/FindPython/Implementation" + "${CMake_BINARY_DIR}/Tests/FindPython/Implementation.CPython3" ${build_generator_args} - --build-project TestIronPython2 - --build-options ${build_options} -DPython2_FIND_STRATEGY=LOCATION + --build-project TestImplementationCPython + --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_REQUESTED_IMPLEMENTATIONS=CPython --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) - add_test(NAME FindPython.IronPython2.VERSION COMMAND + add_test(NAME FindPython.Implementation.IronPython3 COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython2" - "${CMake_BINARY_DIR}/Tests/FindPython/IronPython2.VERSION" + "${CMake_SOURCE_DIR}/Tests/FindPython/Implementation" + "${CMake_BINARY_DIR}/Tests/FindPython/Implementation.IronPython3" ${build_generator_args} - --build-project TestIronPython2 - --build-options ${build_options} -DPython2_FIND_STRATEGY=VERSION + --build-project TestImplementationIronPython + --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_REQUESTED_IMPLEMENTATION=IronPython --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) - add_test(NAME FindPython.IronPython.LOCATION COMMAND + set_property(TEST FindPython.Implementation.CPython3 FindPython.Implementation.IronPython3 + APPEND PROPERTY LABELS Python3) +endif() + +if(CMake_TEST_FindPython2_IronPython) + add_test(NAME FindPython.IronPython2.LOCATION COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython" - "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.LOCATION" + "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython2" + "${CMake_BINARY_DIR}/Tests/FindPython/IronPython2.LOCATION" ${build_generator_args} - --build-project TestIronPython - --build-options ${build_options} -DPython_FIND_STRATEGY=LOCATION + --build-project TestIronPython2 + --build-options ${build_options} -DPython2_FIND_STRATEGY=LOCATION --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) - add_test(NAME FindPython.IronPython.VERSION COMMAND + add_test(NAME FindPython.IronPython2.VERSION COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython" - "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.VERSION" + "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython2" + "${CMake_BINARY_DIR}/Tests/FindPython/IronPython2.VERSION" ${build_generator_args} - --build-project TestIronPython - --build-options ${build_options} -DPython_FIND_STRATEGY=VERSION + --build-project TestIronPython2 + --build-options ${build_options} -DPython2_FIND_STRATEGY=VERSION --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) + add_test(NAME FindPython.IronPython.V2.LOCATION COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test @@ -651,71 +707,133 @@ if(CMake_TEST_FindPython_IronPython) -DPython2_FIND_IMPLEMENTATIONS=IronPython -DPython2_FIND_STRATEGY=VERSION ) + + set_property(TEST FindPython.IronPython2.LOCATION FindPython.IronPython2.VERSION + FindPython.IronPython.V2.LOCATION FindPython.IronPython.V2.VERSION + FindPython.IronPython2.VersionRange.LOCATION FindPython.IronPython2.VersionRange.VERSION + APPEND PROPERTY LABELS Python2) endif() -if(CMake_TEST_FindPython_PyPy) - add_test(NAME FindPython.PyPy2.LOCATION COMMAND +if(CMake_TEST_FindPython3_IronPython) + add_test(NAME FindPython.IronPython3.LOCATION COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy2" - "${CMake_BINARY_DIR}/Tests/FindPython/PyPy2.LOCATION" + "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython3" + "${CMake_BINARY_DIR}/Tests/FindPython/IronPython3.LOCATION" ${build_generator_args} - --build-project TestPyPy2 - --build-options ${build_options} -DPython2_FIND_STRATEGY=LOCATION + --build-project TestIronPython3 + --build-options ${build_options} -DPython3_FIND_STRATEGY=LOCATION --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) - add_test(NAME FindPython.PyPy2.VERSION COMMAND + add_test(NAME FindPython.IronPython3.VERSION COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy2" - "${CMake_BINARY_DIR}/Tests/FindPython/PyPy2.VERSION" + "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython3" + "${CMake_BINARY_DIR}/Tests/FindPython/IronPython3.VERSION" ${build_generator_args} - --build-project TestPyPy2 - --build-options ${build_options} -DPython2_FIND_STRATEGY=VERSION + --build-project TestIronPython3 + --build-options ${build_options} -DPython3_FIND_STRATEGY=VERSION --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) - add_test(NAME FindPython.PyPy3.LOCATION COMMAND + add_test(NAME FindPython.IronPython.V3.LOCATION COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy3" - "${CMake_BINARY_DIR}/Tests/FindPython/PyPy3.LOCATION" + "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython" + "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.V3.LOCATION" ${build_generator_args} - --build-project TestPyPy3 - --build-options ${build_options} -DPython3_FIND_STRATEGY=LOCATION + --build-project TestIronPython + --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=LOCATION --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) - add_test(NAME FindPython.PyPy3.VERSION COMMAND + add_test(NAME FindPython.IronPython.V3.VERSION COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy3" - "${CMake_BINARY_DIR}/Tests/FindPython/PyPy3.VERSION" + "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython" + "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.V3.VERSION" ${build_generator_args} - --build-project TestPyPy3 - --build-options ${build_options} -DPython3_FIND_STRATEGY=VERSION + --build-project TestIronPython + --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=VERSION --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) - add_test(NAME FindPython.PyPy.LOCATION COMMAND + add_test(NAME FindPython.IronPython3.VersionRange.LOCATION COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy" - "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.LOCATION" + "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange" + "${CMake_BINARY_DIR}/Tests/FindPython/IronPython3.VersionRange.LOCATION" ${build_generator_args} - --build-project TestPyPy + --build-project TestVersionRange + --build-options ${build_options} -DPython=Python3 -DPython_REQUESTED_VERSION=3 + -DPython3_FIND_IMPLEMENTATIONS=IronPython + -DPython3_FIND_STRATEGY=LOCATION + ) + add_test(NAME FindPython.IronPython3.VersionRange.VERSION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange" + "${CMake_BINARY_DIR}/Tests/FindPython/IronPython3.VersionRange.VERSION" + ${build_generator_args} + --build-project TestVersionRange + --build-options ${build_options} -DPython=Python3 -DPython_REQUESTED_VERSION=3 + -DPython3_FIND_IMPLEMENTATIONS=IronPython + -DPython3_FIND_STRATEGY=VERSION + ) + + set_property(TEST FindPython.IronPython3.LOCATION FindPython.IronPython3.VERSION + FindPython.IronPython.V3.LOCATION FindPython.IronPython.V3.VERSION + FindPython.IronPython3.VersionRange.LOCATION FindPython.IronPython3.VersionRange.VERSION + APPEND PROPERTY LABELS Python3) +endif() + +if(CMake_TEST_FindPython2_IronPython OR CMake_TEST_FindPython3_IronPython) + add_test(NAME FindPython.IronPython.LOCATION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython" + "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.LOCATION" + ${build_generator_args} + --build-project TestIronPython --build-options ${build_options} -DPython_FIND_STRATEGY=LOCATION --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) - add_test(NAME FindPython.PyPy.VERSION COMMAND + add_test(NAME FindPython.IronPython.VERSION COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy" - "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.VERSION" + "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython" + "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.VERSION" ${build_generator_args} - --build-project TestPyPy + --build-project TestIronPython --build-options ${build_options} -DPython_FIND_STRATEGY=VERSION --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) + + set_property(TEST FindPython.IronPython.LOCATION FindPython.IronPython.VERSION + APPEND PROPERTY LABELS Python2 Python3) +endif() + +if(CMake_TEST_FindPython2_PyPy) + add_test(NAME FindPython.PyPy2.LOCATION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy2" + "${CMake_BINARY_DIR}/Tests/FindPython/PyPy2.LOCATION" + ${build_generator_args} + --build-project TestPyPy2 + --build-options ${build_options} -DPython2_FIND_STRATEGY=LOCATION + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + add_test(NAME FindPython.PyPy2.VERSION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy2" + "${CMake_BINARY_DIR}/Tests/FindPython/PyPy2.VERSION" + ${build_generator_args} + --build-project TestPyPy2 + --build-options ${build_options} -DPython2_FIND_STRATEGY=VERSION + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + add_test(NAME FindPython.PyPy.V2.LOCATION COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test @@ -736,6 +854,34 @@ if(CMake_TEST_FindPython_PyPy) --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=VERSION --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) + + set_property(TEST FindPython.PyPy2.LOCATION FindPython.PyPy2.VERSION + FindPython.PyPy.V2.LOCATION FindPython.PyPy.V2.VERSION + APPEND PROPERTY LABELS Python2) +endif() + +if(CMake_TEST_FindPython3_PyPy) + add_test(NAME FindPython.PyPy3.LOCATION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy3" + "${CMake_BINARY_DIR}/Tests/FindPython/PyPy3.LOCATION" + ${build_generator_args} + --build-project TestPyPy3 + --build-options ${build_options} -DPython3_FIND_STRATEGY=LOCATION + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + add_test(NAME FindPython.PyPy3.VERSION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy3" + "${CMake_BINARY_DIR}/Tests/FindPython/PyPy3.VERSION" + ${build_generator_args} + --build-project TestPyPy3 + --build-options ${build_options} -DPython3_FIND_STRATEGY=VERSION + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + add_test(NAME FindPython.PyPy.V3.LOCATION COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test @@ -756,4 +902,34 @@ if(CMake_TEST_FindPython_PyPy) --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=VERSION --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) + + set_property(TEST FindPython.PyPy3.LOCATION FindPython.PyPy3.VERSION + FindPython.PyPy.V3.LOCATION FindPython.PyPy.V3.VERSION + APPEND PROPERTY LABELS Python3) +endif() + +if(CMake_TEST_FindPython2_PyPy OR CMake_TEST_FindPython3_PyPy) + add_test(NAME FindPython.PyPy.LOCATION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy" + "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.LOCATION" + ${build_generator_args} + --build-project TestPyPy + --build-options ${build_options} -DPython_FIND_STRATEGY=LOCATION + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + add_test(NAME FindPython.PyPy.VERSION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy" + "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.VERSION" + ${build_generator_args} + --build-project TestPyPy + --build-options ${build_options} -DPython_FIND_STRATEGY=VERSION + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + + set_property(TEST FindPython.PyPy.LOCATION FindPython.PyPy.VERSION + APPEND PROPERTY LABELS Python2 Python3) endif() diff --git a/Tests/FindPython/CustomFailureMessage/CMakeLists.txt b/Tests/FindPython/CustomFailureMessage/CMakeLists.txt index 283aeec..e0148f3 100644 --- a/Tests/FindPython/CustomFailureMessage/CMakeLists.txt +++ b/Tests/FindPython/CustomFailureMessage/CMakeLists.txt @@ -62,7 +62,7 @@ set_tests_properties(FindPython.CustomFailureMessage.Multiple PROPERTIES PASS_REGULAR_EXPRESSION "Reason given by package:.+Interpreter: Cannot run the interpreter.+Development: Cannot find the library") -if (CMake_TEST_FindPython_NumPy) +if (CMake_TEST_FindPython3_NumPy) add_test(NAME FindPython.CustomFailureMessage.NumPy COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test diff --git a/Tests/FindPython/IronPython3/CMakeLists.txt b/Tests/FindPython/IronPython3/CMakeLists.txt new file mode 100644 index 0000000..b09097a --- /dev/null +++ b/Tests/FindPython/IronPython3/CMakeLists.txt @@ -0,0 +1,31 @@ +cmake_minimum_required(VERSION 3.5) + +project(TestIronPython3 LANGUAGES NONE) + +set (Python3_FIND_IMPLEMENTATIONS "IronPython") + +find_package(Python3 COMPONENTS Interpreter Compiler) +if (NOT Python3_FOUND) + message (FATAL_ERROR "Failed to find Python 3") +endif() + +if (NOT Python3_Interpreter_FOUND) + message (FATAL_ERROR "Failed to find Python 3 Interpreter") +endif() +if (NOT Python3_INTERPRETER_ID STREQUAL "IronPython") + message (FATAL_ERROR "Erroneous interpreter ID (${Python3_INTERPRETER_ID})") +endif() + +if (NOT Python3_Compiler_FOUND) + message (FATAL_ERROR "Failed to find Python 3 Compiler") +endif() +if (NOT Python3_COMPILER_ID STREQUAL "IronPython") + message (FATAL_ERROR "Erroneous compiler ID (${Python3_COMPILER_ID})") +endif() + +if(NOT TARGET Python3::Interpreter) + message(SEND_ERROR "Python3::Interpreter not found") +endif() +if(NOT TARGET Python3::Compiler) + message(SEND_ERROR "Python3::Compiler not found") +endif() diff --git a/Tests/FindPython/MultiplePackages/CMakeLists.txt b/Tests/FindPython/MultiplePackages/CMakeLists.txt index 4845035..352a2f6f 100644 --- a/Tests/FindPython/MultiplePackages/CMakeLists.txt +++ b/Tests/FindPython/MultiplePackages/CMakeLists.txt @@ -2,32 +2,44 @@ cmake_minimum_required(VERSION 3.5) project(TestMultiplePackages C) -find_package (Python2 REQUIRED COMPONENTS Interpreter Development) -find_package (Python3 REQUIRED COMPONENTS Interpreter Development) - -# Must find Python 3 find_package (Python REQUIRED) -if (NOT Python3_EXECUTABLE STREQUAL Python_EXECUTABLE) - message (FATAL_ERROR - "Python interpreters do not match:\n" - " Python_EXECUTABLE='${Python_EXECUTABLE}'\n" - " Python3_EXECUTABLE='${Python3_EXECUTABLE}'\n" +if (CMake_TEST_FindPython2) + find_package (Python2 REQUIRED COMPONENTS Interpreter Development) + + if (NOT CMake_TEST_FindPython3 AND NOT Python2_EXECUTABLE STREQUAL Python_EXECUTABLE) + message (FATAL_ERROR + "Python interpreters do not match:\n" + " Python_EXECUTABLE='${Python_EXECUTABLE}'\n" + " Python2_EXECUTABLE='${Python3_EXECUTABLE}'\n" ) -endif() + endif() + + Python2_add_library (spam2 MODULE ../spam.c) + target_compile_definitions (spam2 PRIVATE PYTHON2) + add_test (NAME python2_spam2 + COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:spam3>" + "${Python2_EXECUTABLE}" -c "import spam2; spam2.system(\"cd\")") -Python2_add_library (spam2 MODULE ../spam.c) -target_compile_definitions (spam2 PRIVATE PYTHON2) +endif() + +if (CMake_TEST_FindPython3) + find_package (Python3 REQUIRED COMPONENTS Interpreter Development) -Python3_add_library (spam3 MODULE ../spam.c) -target_compile_definitions (spam3 PRIVATE PYTHON3) + if (NOT Python3_EXECUTABLE STREQUAL Python_EXECUTABLE) + message (FATAL_ERROR + "Python interpreters do not match:\n" + " Python_EXECUTABLE='${Python_EXECUTABLE}'\n" + " Python3_EXECUTABLE='${Python3_EXECUTABLE}'\n" + ) + endif() + Python3_add_library (spam3 MODULE ../spam.c) + target_compile_definitions (spam3 PRIVATE PYTHON3) -add_test (NAME python2_spam2 - COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:spam3>" - "${Python2_EXECUTABLE}" -c "import spam2; spam2.system(\"cd\")") + add_test (NAME python3_spam3 + COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:spam3>" + "${Python3_EXECUTABLE}" -c "import spam3; spam3.system(\"cd\")") -add_test (NAME python3_spam3 - COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:spam3>" - "${Python3_EXECUTABLE}" -c "import spam3; spam3.system(\"cd\")") +endif() diff --git a/Tests/FindPython/NumPy/CMakeLists.txt b/Tests/FindPython/NumPy/CMakeLists.txt index 9920336..336bb83 100644 --- a/Tests/FindPython/NumPy/CMakeLists.txt +++ b/Tests/FindPython/NumPy/CMakeLists.txt @@ -2,21 +2,30 @@ cmake_minimum_required(VERSION 3.5) project(TestNumPy LANGUAGES C) -find_package (Python2 REQUIRED COMPONENTS Interpreter Development NumPy) -find_package (Python3 REQUIRED COMPONENTS Interpreter Development NumPy) +if(CMake_TEST_FindPython2_NumPy) -Python2_add_library (arraytest2 MODULE arraytest.c) -target_compile_definitions (arraytest2 PRIVATE PYTHON2) -target_link_libraries (arraytest2 PRIVATE Python2::NumPy) + find_package (Python2 REQUIRED COMPONENTS Interpreter Development NumPy) -Python3_add_library (arraytest3 MODULE arraytest.c) -target_compile_definitions (arraytest3 PRIVATE PYTHON3) -target_link_libraries (arraytest3 PRIVATE Python3::NumPy) + Python2_add_library (arraytest2 MODULE arraytest.c) + target_compile_definitions (arraytest2 PRIVATE PYTHON2) + target_link_libraries (arraytest2 PRIVATE Python2::NumPy) -add_test (NAME python2_arraytest - COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:arraytest2>" - "${Python2_EXECUTABLE}" -c "import numpy; import arraytest2; arraytest2.vecsq(numpy.array([1, 2, 3]));") + add_test (NAME python2_arraytest + COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:arraytest2>" + "${Python2_EXECUTABLE}" -c "import numpy; import arraytest2; arraytest2.vecsq(numpy.array([1, 2, 3]));") -add_test (NAME python3_arraytest - COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:arraytest3>" - "${Python3_EXECUTABLE}" -c "import numpy; import arraytest3; arraytest3.vecsq(numpy.array([1, 2, 3]));") +endif() + +if(CMake_TEST_FindPython3_NumPy) + + find_package (Python3 REQUIRED COMPONENTS Interpreter Development NumPy) + + Python3_add_library (arraytest3 MODULE arraytest.c) + target_compile_definitions (arraytest3 PRIVATE PYTHON3) + target_link_libraries (arraytest3 PRIVATE Python3::NumPy) + + add_test (NAME python3_arraytest + COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:arraytest3>" + "${Python3_EXECUTABLE}" -c "import numpy; import arraytest3; arraytest3.vecsq(numpy.array([1, 2, 3]));") + +endif() diff --git a/Tests/FindPython/NumPyOnly/CMakeLists.txt b/Tests/FindPython/NumPyOnly/CMakeLists.txt index 9aa1bcf..115cf2b 100644 --- a/Tests/FindPython/NumPyOnly/CMakeLists.txt +++ b/Tests/FindPython/NumPyOnly/CMakeLists.txt @@ -2,13 +2,23 @@ cmake_minimum_required(VERSION 3.5) project(TestNumPyOnly LANGUAGES C) -find_package(Python2 REQUIRED COMPONENTS NumPy) -find_package(Python3 REQUIRED COMPONENTS NumPy) +if(CMake_TEST_FindPython2_NumPy) + + find_package(Python2 REQUIRED COMPONENTS NumPy) + + Python2_add_library (arraytest2 MODULE ../NumPy/arraytest.c) + target_compile_definitions (arraytest2 PRIVATE PYTHON2) + target_link_libraries (arraytest2 PRIVATE Python2::NumPy) + +endif() -Python2_add_library (arraytest2 MODULE ../NumPy/arraytest.c) -target_compile_definitions (arraytest2 PRIVATE PYTHON2) -target_link_libraries (arraytest2 PRIVATE Python2::NumPy) + +if(CMake_TEST_FindPython3_NumPy) + +find_package(Python3 REQUIRED COMPONENTS NumPy) Python3_add_library (arraytest3 MODULE ../NumPy/arraytest.c) target_compile_definitions (arraytest3 PRIVATE PYTHON3) target_link_libraries (arraytest3 PRIVATE Python3::NumPy) + +endif() diff --git a/Tests/FindPython/RequiredArtifacts/CMakeLists.txt b/Tests/FindPython/RequiredArtifacts/CMakeLists.txt index cb9d4d3..eec28a5 100644 --- a/Tests/FindPython/RequiredArtifacts/CMakeLists.txt +++ b/Tests/FindPython/RequiredArtifacts/CMakeLists.txt @@ -4,13 +4,20 @@ project(TestRequiredArtifacts LANGUAGES C) include(CTest) -find_package(Python2 REQUIRED COMPONENTS Interpreter Development) -if (NOT Python2_FOUND) - message (FATAL_ERROR "Failed to find Python 2") +if(CMake_TEST_FindPython2) + find_package(Python2 REQUIRED COMPONENTS Interpreter Development) + if (NOT Python2_FOUND) + message (FATAL_ERROR "Failed to find Python 2") + endif() + set(USER_LIBRARY "${Python2_LIBRARY_RELEASE}") + set(USER_INCLUDE_DIR "${Python2_INCLUDE_DIRS}") +else() + set(USER_LIBRARY "/path/to/invalid${CMAKE_C_LINK_LIBRARY_SUFFIX}") + set(USER_INCLUDE_DIR "/path/to/invalid/dir") endif() set(components Interpreter Development) -if (CMake_TEST_FindPython_SABIModule AND WIN32) +if (CMake_TEST_FindPython3_SABIModule AND WIN32) list (APPEND components Development.SABIModule) endif() find_package(Python3 REQUIRED COMPONENTS ${components}) @@ -61,7 +68,7 @@ add_test(NAME FindPython.RequiredArtifacts.Library.INVALID COMMAND ${build_generator_args} --build-project TestRequiredArtifacts.Check --build-options -DPYTHON_IS_FOUND=FALSE -DCHECK_LIBRARY=ON - "-DPython3_LIBRARY=${Python2_LIBRARY_RELEASE}" + "-DPython3_LIBRARY=${USER_LIBRARY}" --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) @@ -84,7 +91,7 @@ add_test(NAME FindPython.RequiredArtifacts.Include.INVALID COMMAND ${build_generator_args} --build-project TestRequiredArtifacts.Check --build-options -DPYTHON_IS_FOUND=FALSE -DCHECK_INCLUDE=ON - "-DPython3_INCLUDE_DIR=${Python2_INCLUDE_DIRS}" + "-DPython3_INCLUDE_DIR=${USER_INCLUDE_DIR}" --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) @@ -97,7 +104,7 @@ add_test(NAME FindPython.RequiredArtifacts.Interpreter-Library.INVALID COMMAND --build-project TestRequiredArtifacts.Check --build-options -DPYTHON_IS_FOUND=FALSE -DCHECK_INTERPRETER=ON -DCHECK_LIBRARY=ON "-DPython3_EXECUTABLE=${Python3_EXECUTABLE}" - "-DPython3_LIBRARY=${Python2_LIBRARY_RELEASE}" + "-DPython3_LIBRARY=${USER_LIBRARY}" --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) @@ -110,11 +117,11 @@ add_test(NAME FindPython.RequiredArtifacts.Library-Include.INVALID COMMAND --build-project TestRequiredArtifacts.Check --build-options -DPYTHON_IS_FOUND=FALSE -DCHECK_LIBRARY=ON -DCHECK_INCLUDE=ON "-DPython3_LIBRARY=${Python3_LIBRARY_RELEASE}" - "-DPython3_INCLUDE_DIR=${Python2_INCLUDE_DIRS}" + "-DPython3_INCLUDE_DIR=${USER_INCLUDE_DIR}" --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) -if (CMake_TEST_FindPython_SABIModule AND WIN32) +if (CMake_TEST_FindPython3_SABIModule AND WIN32) add_test(NAME FindPython.RequiredArtifacts.SABILibrary.VALID COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test @@ -134,7 +141,7 @@ if (CMake_TEST_FindPython_SABIModule AND WIN32) ${build_generator_args} --build-project TestRequiredArtifacts.Check --build-options -DPYTHON_IS_FOUND=FALSE -DCHECK_SABI_LIBRARY=ON - "-DPython3_SABI_LIBRARY=${Python2_LIBRARY_RELEASE}" + "-DPython3_SABI_LIBRARY=${USER_LIBRARY}" --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) endif() diff --git a/Tests/FindPython/SOABI/CMakeLists.txt b/Tests/FindPython/SOABI/CMakeLists.txt index 60399d3..6c0e9a9 100644 --- a/Tests/FindPython/SOABI/CMakeLists.txt +++ b/Tests/FindPython/SOABI/CMakeLists.txt @@ -2,37 +2,40 @@ cmake_minimum_required(VERSION 3.5) project(TestSOABI LANGUAGES C) -find_package(Python3 COMPONENTS ${CMake_TEST_FindPython_COMPONENT}) -if (NOT Python3_FOUND) - message (FATAL_ERROR "Failed to find Python 3") -endif() +if(CMake_TEST_FindPython3) + find_package(Python3 COMPONENTS ${CMake_TEST_FindPython_COMPONENT}) + if (NOT Python3_FOUND) + message (FATAL_ERROR "Failed to find Python 3") + endif() -if(NOT DEFINED Python3_SOABI) - message(FATAL_ERROR "Python3_SOABI for ${CMake_TEST_FindPython_COMPONENT} not found") -endif() + if(NOT DEFINED Python3_SOABI) + message(FATAL_ERROR "Python3_SOABI for ${CMake_TEST_FindPython_COMPONENT} not found") + endif() -if (Python3_Development_FOUND AND Python3_SOABI) - Python3_add_library (spam3 MODULE WITH_SOABI ../spam.c) - target_compile_definitions (spam3 PRIVATE PYTHON3) + if (Python3_Development_FOUND AND Python3_SOABI) + Python3_add_library (spam3 MODULE WITH_SOABI ../spam.c) + target_compile_definitions (spam3 PRIVATE PYTHON3) - get_property (suffix TARGET spam3 PROPERTY SUFFIX) - if (NOT suffix MATCHES "^.${Python3_SOABI}") - message(FATAL_ERROR "Module suffix do not include Python3_SOABI") + get_property (suffix TARGET spam3 PROPERTY SUFFIX) + if (NOT suffix MATCHES "^.${Python3_SOABI}") + message(FATAL_ERROR "Module suffix do not include Python3_SOABI") + endif() endif() endif() +if(CMake_TEST_FindPython2) + find_package(Python2 COMPONENTS ${CMake_TEST_FindPython_COMPONENT}) + if(NOT DEFINED Python2_SOABI) + message(FATAL_ERROR "Python2_SOABI for ${CMake_TEST_FindPython_COMPONENT} not found") + endif() -find_package(Python2 COMPONENTS ${CMake_TEST_FindPython_COMPONENT}) -if(NOT DEFINED Python2_SOABI) - message(FATAL_ERROR "Python2_SOABI for ${CMake_TEST_FindPython_COMPONENT} not found") -endif() - -if (Python2_Development_FOUND AND Python2_SOABI) - Python2_add_library (spam2 MODULE WITH_SOABI ../spam.c) - target_compile_definitions (spam2 PRIVATE PYTHON2) + if (Python2_Development_FOUND AND Python2_SOABI) + Python2_add_library (spam2 MODULE WITH_SOABI ../spam.c) + target_compile_definitions (spam2 PRIVATE PYTHON2) - get_property (suffix TARGET spam2 PROPERTY SUFFIX) - if (NOT suffix MATCHES "^.${Python2_SOABI}") - message(FATAL_ERROR "Module suffix do not include Python2_SOABI") + get_property (suffix TARGET spam2 PROPERTY SUFFIX) + if (NOT suffix MATCHES "^.${Python2_SOABI}") + message(FATAL_ERROR "Module suffix do not include Python2_SOABI") + endif() endif() endif() diff --git a/Tests/FindPython/VirtualEnv/CMakeLists.txt b/Tests/FindPython/VirtualEnv/CMakeLists.txt index e2e5bd2..ea742ea 100644 --- a/Tests/FindPython/VirtualEnv/CMakeLists.txt +++ b/Tests/FindPython/VirtualEnv/CMakeLists.txt @@ -27,21 +27,23 @@ add_test(NAME FindPython3.VirtualEnvDefault "${CMAKE_COMMAND}" "-DPYTHON3_VIRTUAL_ENV=${Python3_VIRTUAL_ENV}" -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvDefault.cmake") -add_test(NAME FindPython3.VirtualEnvOnly - COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME - --unset=CONDA_PREFIX - "VIRTUAL_ENV=${Python3_VIRTUAL_ENV}" - "${CMAKE_COMMAND}" "-DPYTHON3_VIRTUAL_ENV=${Python3_VIRTUAL_ENV}" - -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvOnly.cmake") -add_test(NAME FindPython3.UnsetVirtualEnvOnly - COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME - --unset=VIRTUAL_ENV - --unset=CONDA_PREFIX - "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvOnly.cmake") - add_test(NAME FindPython3.VirtualEnvStandard COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME --unset=CONDA_PREFIX "VIRTUAL_ENV=${Python3_VIRTUAL_ENV}" "${CMAKE_COMMAND}" "-DPYTHON3_VIRTUAL_ENV=${Python3_VIRTUAL_ENV}" -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvStandard.cmake") + +if(CMake_TEST_FindPython2) + add_test(NAME FindPython3.VirtualEnvOnly + COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME + --unset=CONDA_PREFIX + "VIRTUAL_ENV=${Python3_VIRTUAL_ENV}" + "${CMAKE_COMMAND}" "-DPYTHON3_VIRTUAL_ENV=${Python3_VIRTUAL_ENV}" + -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvOnly.cmake") + add_test(NAME FindPython3.UnsetVirtualEnvOnly + COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME + --unset=VIRTUAL_ENV + --unset=CONDA_PREFIX + "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvOnly.cmake") +endif() diff --git a/Tests/FindPython/VirtualEnvConda/CMakeLists.txt b/Tests/FindPython/VirtualEnvConda/CMakeLists.txt index 2f7c0db..3a64c31 100644 --- a/Tests/FindPython/VirtualEnvConda/CMakeLists.txt +++ b/Tests/FindPython/VirtualEnvConda/CMakeLists.txt @@ -26,21 +26,23 @@ add_test(NAME FindPython3.VirtualEnvDefaultConda "${CMAKE_COMMAND}" "-DPYTHON3_VIRTUAL_ENV=${Python3_VIRTUAL_ENV}" -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvDefault.cmake") -add_test(NAME FindPython3.VirtualEnvOnlyConda - COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME - --unset=VIRTUAL_ENV - "CONDA_PREFIX=${Python3_VIRTUAL_ENV}" - "${CMAKE_COMMAND}" "-DPYTHON3_VIRTUAL_ENV=${Python3_VIRTUAL_ENV}" - -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvOnly.cmake") -add_test(NAME FindPython3.UnsetVirtualEnvOnlyConda - COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME - --unset=CONDA_PREFIX - --unset=VIRTUAL_ENV - "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvOnly.cmake") - add_test(NAME FindPython3.VirtualEnvStandardConda COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME --unset=VIRTUAL_ENV "CONDA_PREFIX=${Python3_VIRTUAL_ENV}" "${CMAKE_COMMAND}" "-DPYTHON3_VIRTUAL_ENV=${Python3_VIRTUAL_ENV}" -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvStandard.cmake") + +if(Cmake_TEST_FindPython2) + add_test(NAME FindPython3.VirtualEnvOnlyConda + COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME + --unset=VIRTUAL_ENV + "CONDA_PREFIX=${Python3_VIRTUAL_ENV}" + "${CMAKE_COMMAND}" "-DPYTHON3_VIRTUAL_ENV=${Python3_VIRTUAL_ENV}" + -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvOnly.cmake") + add_test(NAME FindPython3.UnsetVirtualEnvOnlyConda + COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME + --unset=CONDA_PREFIX + --unset=VIRTUAL_ENV + "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvOnly.cmake") +endif() diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt index ef115e6..df7cda0 100644 --- a/Tests/GeneratorExpression/CMakeLists.txt +++ b/Tests/GeneratorExpression/CMakeLists.txt @@ -214,6 +214,22 @@ set_property(TARGET importedFallback2 PROPERTY IMPORTED_IMPLIB_SPECIAL special_i set_property(TARGET importedFallback2 PROPERTY MAP_IMPORTED_CONFIG_NOCONFIG SPECIAL "") set_property(TARGET importedFallback2 PROPERTY MAP_IMPORTED_CONFIG_DEBUG SPECIAL "") set_property(TARGET importedFallback2 PROPERTY MAP_IMPORTED_CONFIG_RELEASE SPECIAL "") +set_property(TARGET importedFallback2 PROPERTY MAP_IMPORTED_CONFIG_RELWITHDEBINFO SPECIAL "") + +add_library(importedFallback3 SHARED IMPORTED) +set_property(TARGET importedFallback3 PROPERTY IMPORTED_LOCATION_DEBUG debug_loc) +set_property(TARGET importedFallback3 PROPERTY IMPORTED_LOCATION_RELEASE release_loc) +set_property(TARGET importedFallback3 PROPERTY IMPORTED_LOCATION fallback_loc) +set_property(TARGET importedFallback3 PROPERTY IMPORTED_IMPLIB imp_loc) +set_property(TARGET importedFallback3 PROPERTY MAP_IMPORTED_CONFIG_DEBUG "" DEBUG) +set_property(TARGET importedFallback3 PROPERTY MAP_IMPORTED_CONFIG_RELEASE "") + +add_library(importedFallback4 SHARED IMPORTED) +set_property(TARGET importedFallback4 PROPERTY IMPORTED_LOCATION fallback_loc) +set_property(TARGET importedFallback4 PROPERTY IMPORTED_IMPLIB imp_loc) + +add_library(importedFallback5 SHARED IMPORTED) +set_property(TARGET importedFallback5 PROPERTY IMPORTED_IMPLIB imp_loc) add_library(importedFallback_genex STATIC IMPORTED) set_property(TARGET importedFallback_genex PROPERTY IMPORTED_CONFIGURATIONS RELEASE) @@ -232,7 +248,10 @@ add_custom_target(check-part3 ALL -Dconfig=$<CONFIGURATION> -Dtest_imported_includes=$<TARGET_PROPERTY:imported4,INCLUDE_DIRECTORIES> -Dtest_imported_fallback=$<STREQUAL:$<TARGET_FILE_NAME:importedFallback>,fallback_loc> - -Dtest_imported_fallback2=$<IF:$<OR:$<PLATFORM_ID:Windows,CYGWIN,MSYS>,$<AND:$<PLATFORM_ID:Darwin>,$<BOOL:${CMAKE_TAPI}>>>,$<STREQUAL:$<TARGET_LINKER_FILE_NAME:importedFallback2>,special_imp>,$<STREQUAL:$<TARGET_LINKER_FILE_NAME:importedFallback2>,fallback_loc>> + -Dtest_imported_fallback2=$<STREQUAL:$<TARGET_LINKER_FILE_NAME:importedFallback2>,special_imp> + -Dtest_imported_fallback3=$<IF:$<PLATFORM_ID:Windows,CYGWIN,MSYS>,$<STREQUAL:$<TARGET_LINKER_FILE_NAME:importedFallback3>,imp_loc>,$<STREQUAL:$<TARGET_LINKER_FILE_NAME:importedFallback3>,fallback_loc>> + -Dtest_imported_fallback4=$<IF:$<PLATFORM_ID:Windows,CYGWIN,MSYS>,$<STREQUAL:$<TARGET_LINKER_FILE_NAME:importedFallback4>,imp_loc>,$<STREQUAL:$<TARGET_LINKER_FILE_NAME:importedFallback4>,fallback_loc>> + -Dtest_imported_fallback5=$<STREQUAL:$<TARGET_LINKER_FILE_NAME:importedFallback5>,imp_loc> -Dtest_imported_fallback_genex=$<STREQUAL:$<TARGET_PROPERTY:importedFallback_genex,INTERFACE_COMPILE_DEFINITIONS>,FOOBAR=1> -Dtest_alias_file_exe=$<STREQUAL:$<TARGET_FILE:Alias::SomeExe>,$<TARGET_FILE:someexe>> -Dtest_alias_file_lib=$<STREQUAL:$<TARGET_FILE:Alias::SomeLib>,$<TARGET_FILE:empty1>> diff --git a/Tests/GeneratorExpression/check-part3.cmake b/Tests/GeneratorExpression/check-part3.cmake index 7bb0d85..eda3bc1 100644 --- a/Tests/GeneratorExpression/check-part3.cmake +++ b/Tests/GeneratorExpression/check-part3.cmake @@ -20,6 +20,9 @@ endif() check(test_imported_fallback "1") check(test_imported_fallback2 "1") +check(test_imported_fallback3 "1") +check(test_imported_fallback4 "1") +check(test_imported_fallback5 "1") check(test_imported_fallback_genex "1") check(test_alias_file_exe "1") diff --git a/Tests/RunCMake/CMP0111/CMP0111-Common.cmake b/Tests/RunCMake/CMP0111/CMP0111-Common.cmake index c31e4ba..ab9e405 100644 --- a/Tests/RunCMake/CMP0111/CMP0111-Common.cmake +++ b/Tests/RunCMake/CMP0111/CMP0111-Common.cmake @@ -1,6 +1,3 @@ -# Prevent duplicate errors on some platforms. -set(CMAKE_IMPORT_LIBRARY_SUFFIX "placeholder") - add_library(unknown_lib UNKNOWN IMPORTED) add_library(static_lib STATIC IMPORTED) add_library(shared_lib SHARED IMPORTED) diff --git a/Tests/RunCMake/CMP0111/CMP0111-NEW-stderr.txt b/Tests/RunCMake/CMP0111/CMP0111-NEW-stderr.txt index 91a90e5..c6439e2 100644 --- a/Tests/RunCMake/CMP0111/CMP0111-NEW-stderr.txt +++ b/Tests/RunCMake/CMP0111/CMP0111-NEW-stderr.txt @@ -1,17 +1,6 @@ -^CMake Error in CMakeLists.txt: - IMPORTED_LOCATION not set for imported target "unknown_lib"( configuration +^(CMake Error in CMakeLists.txt: + IMPORTED_(LOCATION|IMPLIB) not set for imported target "(unknown|static)_lib"( configuration "[^"]+")?. -+ -CMake Error in CMakeLists.txt: - IMPORTED_LOCATION not set for imported target "static_lib"( configuration - "[^"]+")?. -+ -CMake Error in CMakeLists.txt: - IMPORTED_IMPLIB not set for imported target "shared_lib"( configuration - "[^"]+")?.( -+ -CMake Error in CMakeLists.txt: - IMPORTED_(LOCATION|IMPLIB) not set for imported target "(unknown|static|shared)_lib"( configuration - "[^"]+")?.)* -+ +)+ +.*(IMPORTED_LOCATION or )?IMPORTED_IMPLIB not set for imported target.*"shared_lib".* CMake Generate step failed. Build files cannot be regenerated correctly.$ diff --git a/Tests/RunCMake/CMP0111/CMP0111-WARN-stderr.txt b/Tests/RunCMake/CMP0111/CMP0111-WARN-stderr.txt index 27af911..7a46c41 100644 --- a/Tests/RunCMake/CMP0111/CMP0111-WARN-stderr.txt +++ b/Tests/RunCMake/CMP0111/CMP0111-WARN-stderr.txt @@ -1,39 +1,19 @@ -^CMake Warning \(dev\) in CMakeLists.txt: +^(CMake Warning \(dev\) in CMakeLists.txt: Policy CMP0111 is not set: An imported target missing its location property fails during generation. Run "cmake --help-policy CMP0111" for policy details. Use the cmake_policy command to set the policy and suppress this warning. - IMPORTED_LOCATION not set for imported target "unknown_lib"( configuration + IMPORTED_(LOCATION|IMPLIB) not set for imported target "(unknown|static)_lib"( configuration "[^"]+")?. This warning is for project developers. Use -Wno-dev to suppress it. -+ -CMake Warning \(dev\) in CMakeLists.txt: ++)+CMake Warning \(dev\) in CMakeLists.txt: Policy CMP0111 is not set: An imported target missing its location property fails during generation. Run "cmake --help-policy CMP0111" for policy details. Use the cmake_policy command to set the policy and suppress this warning. - IMPORTED_LOCATION not set for imported target "static_lib"( configuration + IMPORTED_(LOCATION|IMPLIB) not set for imported target "(unknown|static)_lib"( configuration "[^"]+")?. -This warning is for project developers. Use -Wno-dev to suppress it. -+ -CMake Warning \(dev\) in CMakeLists.txt: - Policy CMP0111 is not set: An imported target missing its location property - fails during generation. Run "cmake --help-policy CMP0111" for policy - details. Use the cmake_policy command to set the policy and suppress this - warning. - - IMPORTED_IMPLIB not set for imported target "shared_lib"( configuration - "[^"]+")?. -This warning is for project developers. Use -Wno-dev to suppress it.( -+ -CMake Warning \(dev\) in CMakeLists.txt: - Policy CMP0111 is not set: An imported target missing its location property - fails during generation. Run "cmake --help-policy CMP0111" for policy - details. Use the cmake_policy command to set the policy and suppress this - warning. - - IMPORTED_(LOCATION|IMPLIB) not set for imported target "(unknown|static|shared)_lib"( configuration - "[^"]+")?. -This warning is for project developers. Use -Wno-dev to suppress it.)*$ +.*(IMPORTED_LOCATION or )?IMPORTED_IMPLIB not set for imported target.*"shared_lib".* +This warning is for project developers. Use -Wno-dev to suppress it.$ diff --git a/Tests/RunCMake/CMP0115/CMP0115-OLD-stderr.txt b/Tests/RunCMake/CMP0115/CMP0115-OLD-stderr.txt index 67d00f7..3472f33 100644 --- a/Tests/RunCMake/CMP0115/CMP0115-OLD-stderr.txt +++ b/Tests/RunCMake/CMP0115/CMP0115-OLD-stderr.txt @@ -1,4 +1,13 @@ -^CMake Error at CMP0115\.cmake:[0-9]+ \(add_executable\): +^CMake Deprecation Warning at CMakeLists\.txt:[0-9]+ \(cmake_minimum_required\): + The OLD behavior for policy CMP0115 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. ++ +CMake Error at CMP0115\.cmake:[0-9]+ \(add_executable\): Cannot find source file: noexist diff --git a/Tests/RunCMake/CMP0116/CMP0116-Mixed-stderr.txt b/Tests/RunCMake/CMP0116/CMP0116-Mixed-stderr.txt index 10e83a9..930dd3c 100644 --- a/Tests/RunCMake/CMP0116/CMP0116-Mixed-stderr.txt +++ b/Tests/RunCMake/CMP0116/CMP0116-Mixed-stderr.txt @@ -1,4 +1,15 @@ -^CMake Warning \(dev\) at CMP0116-Mixed\.cmake:1 \(add_custom_command\): +^CMake Deprecation Warning at CMP0116-Mixed\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0116 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +CMake Warning \(dev\) at CMP0116-Mixed\.cmake:1 \(add_custom_command\): Policy CMP0116 is not set: Ninja generators transform DEPFILEs from add_custom_command\(\)\. Run "cmake --help-policy CMP0116" for policy details\. Use the cmake_policy command to set the policy and suppress this diff --git a/Tests/RunCMake/CMP0116/CMP0116-OLD-NOWARN-stderr.txt b/Tests/RunCMake/CMP0116/CMP0116-OLD-NOWARN-stderr.txt new file mode 100644 index 0000000..887601c --- /dev/null +++ b/Tests/RunCMake/CMP0116/CMP0116-OLD-NOWARN-stderr.txt @@ -0,0 +1,8 @@ +^CMake Deprecation Warning at CMakeLists\.txt:[0-9]+ \(cmake_minimum_required\): + The OLD behavior for policy CMP0116 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\.$ diff --git a/Tests/RunCMake/CMP0116/CMP0116-OLD-WARN-stderr.txt b/Tests/RunCMake/CMP0116/CMP0116-OLD-WARN-stderr.txt new file mode 100644 index 0000000..887601c --- /dev/null +++ b/Tests/RunCMake/CMP0116/CMP0116-OLD-WARN-stderr.txt @@ -0,0 +1,8 @@ +^CMake Deprecation Warning at CMakeLists\.txt:[0-9]+ \(cmake_minimum_required\): + The OLD behavior for policy CMP0116 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\.$ diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test1-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test1-stderr.txt index 2af72a4..9285f9d 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test1-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test1-stderr.txt @@ -1,4 +1,15 @@ -^prop: `0` +^CMake Deprecation Warning at CMP0118-OLD-Test1\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +prop: `0` CMake Error at CMP0118-Common-Test1\.cmake:[0-9]+ \(target_sources\): Cannot find source file: diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test10-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test10-stderr.txt index 6109f65..9bd3d33 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test10-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test10-stderr.txt @@ -1,4 +1,15 @@ -^Generated_source0\.txt: # 1a # GENERATED = `1` +^CMake Deprecation Warning at CMP0118-OLD-Test10\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +Generated_source0\.txt: # 1a # GENERATED = `1` Generated_source0\.txt: # 1b # GENERATED = `1` Generated_source0\.txt: # 2a # GENERATED = `1` Generated_source0\.txt: # 2b # GENERATED = `1` diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test11-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test11-stderr.txt index e5e97de..4730caf 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test11-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test11-stderr.txt @@ -1,4 +1,15 @@ -^Generated_source0\.txt: # 1a # GENERATED = `1` +^CMake Deprecation Warning at CMP0118-OLD-Test11\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +Generated_source0\.txt: # 1a # GENERATED = `1` Generated_source0\.txt: # 1b # GENERATED = `1` Generated_source0\.txt: # 2a # GENERATED = `1` Generated_source0\.txt: # 2b # GENERATED = `1` diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test12-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test12-stderr.txt index e6c429c..69a07e1 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test12-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test12-stderr.txt @@ -1,4 +1,15 @@ -^CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\): +^CMake Deprecation Warning at CMP0118-OLD-Test12\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\): TARGET 'custom[4-6]' was not created in this directory\. + CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\): diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test13-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test13-stderr.txt index 75dbf23..45c1dcb 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test13-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test13-stderr.txt @@ -1,4 +1,15 @@ -^CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\): +^CMake Deprecation Warning at CMP0118-OLD-Test13\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\): TARGET 'custom[4-6]' was not created in this directory\. + CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\): diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test14-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test14-stderr.txt index f5b3d1a..7ade0cf 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test14-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test14-stderr.txt @@ -1,4 +1,15 @@ -^Generated_source0\.txt: # 1a # GENERATED = `1` +^CMake Deprecation Warning at CMP0118-OLD-Test14\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +Generated_source0\.txt: # 1a # GENERATED = `1` Generated_source0\.txt: # 1b # GENERATED = `1` Generated_source0\.txt: # 2a # GENERATED = `1` Generated_source0\.txt: # 2b # GENERATED = `1` diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test15-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test15-stderr.txt index a30bc84..5735539 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test15-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test15-stderr.txt @@ -1,4 +1,15 @@ -^Generated_source0\.txt: # 1a # GENERATED = `1` +^CMake Deprecation Warning at CMP0118-OLD-Test15\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +Generated_source0\.txt: # 1a # GENERATED = `1` Generated_source0\.txt: # 1b # GENERATED = `1` Generated_source0\.txt: # 2a # GENERATED = `1` Generated_source0\.txt: # 2b # GENERATED = `1` diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test2-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test2-stderr.txt index 403ce5a..74eb3e1 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test2-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test2-stderr.txt @@ -1 +1,12 @@ -^prop: `1`$ +^CMake Deprecation Warning at CMP0118-OLD-Test2\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +prop: `1`$ diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3-stderr.txt index 4f4fea3..cce5b19 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3-stderr.txt @@ -1,4 +1,15 @@ -^Generated_with_full_path1\.txt: # 1a # GENERATED = `1` +^CMake Deprecation Warning at CMP0118-OLD-Test3\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +Generated_with_full_path1\.txt: # 1a # GENERATED = `1` Generated_with_full_path1\.txt: # 1b # GENERATED = `1` Generated_with_full_path1\.txt: # 2a # GENERATED = `1` Generated_with_full_path1\.txt: # 2b # GENERATED = `1` diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3b-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3b-stderr.txt index 3c80531..47eee2e 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3b-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3b-stderr.txt @@ -1,4 +1,15 @@ -^Generated_with_full_path1\.txt: # 1a # GENERATED = `1` +^CMake Deprecation Warning at CMP0118-OLD-Test3b\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +Generated_with_full_path1\.txt: # 1a # GENERATED = `1` Generated_with_full_path1\.txt: # 1b # GENERATED = `1` Generated_with_full_path1\.txt: # 2a # GENERATED = `1` Generated_with_full_path1\.txt: # 2b # GENERATED = `1` diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4-stderr.txt index 9600fee..f17c9be 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4-stderr.txt @@ -1,4 +1,15 @@ -^Generated_with_full_path1\.txt: # 1a # GENERATED = `0` +^CMake Deprecation Warning at CMP0118-OLD-Test4\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +Generated_with_full_path1\.txt: # 1a # GENERATED = `0` Generated_with_full_path1\.txt: # 1b # GENERATED = `0` Generated_with_full_path1\.txt: # 2a # GENERATED = `0` Generated_with_full_path1\.txt: # 2b # GENERATED = `0` diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4b-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4b-stderr.txt index e638660..388e90e 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4b-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4b-stderr.txt @@ -1,4 +1,15 @@ -^Generated_with_full_path1\.txt: # 1a # GENERATED = `0` +^CMake Deprecation Warning at CMP0118-OLD-Test4b\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +Generated_with_full_path1\.txt: # 1a # GENERATED = `0` Generated_with_full_path1\.txt: # 1b # GENERATED = `0` Generated_with_full_path1\.txt: # 2a # GENERATED = `0` Generated_with_full_path1\.txt: # 2b # GENERATED = `0` diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test5-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test5-stderr.txt index 18e6a8c..4a67fa7 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test5-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test5-stderr.txt @@ -1,4 +1,15 @@ -^Generated_with_full_path1\.txt: # 1a # GENERATED = `1` +^CMake Deprecation Warning at CMP0118-OLD-Test5\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +Generated_with_full_path1\.txt: # 1a # GENERATED = `1` Generated_with_full_path1\.txt: # 1b # GENERATED = `1` Generated_with_full_path1\.txt: # 2a # GENERATED = `1` Generated_with_full_path1\.txt: # 2b # GENERATED = `1` diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test6-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test6-stderr.txt index a60545f..0cad373 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test6-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test6-stderr.txt @@ -1,4 +1,15 @@ -^Generated_source1\.txt: # 1a # GENERATED = `1` +^CMake Deprecation Warning at CMP0118-OLD-Test6\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +Generated_source1\.txt: # 1a # GENERATED = `1` Generated_source1\.txt: # 1b # GENERATED = `1` Generated_source1\.txt: # 2a # GENERATED = `1` Generated_source1\.txt: # 2b # GENERATED = `1` diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test7-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test7-stderr.txt index fd496cb..7f232d5 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test7-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test7-stderr.txt @@ -1,4 +1,15 @@ -^Generated_source1\.txt: # 1a # GENERATED = `1` +^CMake Deprecation Warning at CMP0118-OLD-Test7\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +Generated_source1\.txt: # 1a # GENERATED = `1` Generated_source1\.txt: # 1b # GENERATED = `1` Generated_source1\.txt: # 2a # GENERATED = `1` Generated_source1\.txt: # 2b # GENERATED = `1` diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test8-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test8-stderr.txt index 3505242..dd9d2ef 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test8-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test8-stderr.txt @@ -1,4 +1,15 @@ -^Generated_source1\.txt: # 1a # GENERATED = `0` +^CMake Deprecation Warning at CMP0118-OLD-Test8\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +Generated_source1\.txt: # 1a # GENERATED = `0` Generated_source1\.txt: # 1b # GENERATED = `0` Generated_source1\.txt: # 2a # GENERATED = `0` Generated_source1\.txt: # 2b # GENERATED = `0` diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test9-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test9-stderr.txt index 63a9341..e01f782 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test9-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test9-stderr.txt @@ -1,4 +1,15 @@ -^Generated_source1\.txt: # 1a # GENERATED = `0` +^CMake Deprecation Warning at CMP0118-OLD-Test9\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +Generated_source1\.txt: # 1a # GENERATED = `0` Generated_source1\.txt: # 1b # GENERATED = `0` Generated_source1\.txt: # 2a # GENERATED = `0` Generated_source1\.txt: # 2b # GENERATED = `0` diff --git a/Tests/RunCMake/CMP0118/GenInSubdir-OLD-stderr.txt b/Tests/RunCMake/CMP0118/GenInSubdir-OLD-stderr.txt index 5e9cf6c..2fc472b 100644 --- a/Tests/RunCMake/CMP0118/GenInSubdir-OLD-stderr.txt +++ b/Tests/RunCMake/CMP0118/GenInSubdir-OLD-stderr.txt @@ -1,4 +1,15 @@ -^CMake Error at GenInSubdir/CMakeLists\.txt:[0-9]+ \(target_sources\): +^CMake Deprecation Warning at GenInSubdir-OLD\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +CMake Error at GenInSubdir/CMakeLists\.txt:[0-9]+ \(target_sources\): Cannot find source file: [^ diff --git a/Tests/RunCMake/CMP0119/CMP0119-OLD-stderr.txt b/Tests/RunCMake/CMP0119/CMP0119-OLD-stderr.txt new file mode 100644 index 0000000..86eac41 --- /dev/null +++ b/Tests/RunCMake/CMP0119/CMP0119-OLD-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0119-OLD\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0119 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/CMP0152/CMP0152-Common.cmake b/Tests/RunCMake/CMP0152/CMP0152-Common.cmake new file mode 100644 index 0000000..6429cca --- /dev/null +++ b/Tests/RunCMake/CMP0152/CMP0152-Common.cmake @@ -0,0 +1,5 @@ +file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/dir/") +file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/dir/nested/") +file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/dir/nested/bin/") +file(CREATE_LINK "${CMAKE_CURRENT_BINARY_DIR}/dir/nested/bin" "${CMAKE_CURRENT_BINARY_DIR}/dir/bin" SYMBOLIC) +file(REAL_PATH "${CMAKE_CURRENT_BINARY_DIR}/dir/bin/../" real_path) diff --git a/Tests/RunCMake/CommandLine/DeprecateVS11-WARN-ON.cmake b/Tests/RunCMake/CMP0152/CMP0152-NEW-stdout.txt index e69de29..e69de29 100644 --- a/Tests/RunCMake/CommandLine/DeprecateVS11-WARN-ON.cmake +++ b/Tests/RunCMake/CMP0152/CMP0152-NEW-stdout.txt diff --git a/Tests/RunCMake/CMP0152/CMP0152-NEW.cmake b/Tests/RunCMake/CMP0152/CMP0152-NEW.cmake new file mode 100644 index 0000000..86a3b55 --- /dev/null +++ b/Tests/RunCMake/CMP0152/CMP0152-NEW.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0152 NEW) +include(CMP0152-Common.cmake) diff --git a/Tests/RunCMake/CommandLine/DeprecateVS11-WARN-OFF.cmake b/Tests/RunCMake/CMP0152/CMP0152-OLD-stderr.txt index e69de29..e69de29 100644 --- a/Tests/RunCMake/CommandLine/DeprecateVS11-WARN-OFF.cmake +++ b/Tests/RunCMake/CMP0152/CMP0152-OLD-stderr.txt diff --git a/Tests/RunCMake/CMP0152/CMP0152-OLD.cmake b/Tests/RunCMake/CMP0152/CMP0152-OLD.cmake new file mode 100644 index 0000000..62ac300 --- /dev/null +++ b/Tests/RunCMake/CMP0152/CMP0152-OLD.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0152 OLD) +include(CMP0152-Common.cmake) diff --git a/Tests/RunCMake/CMP0152/CMP0152-WARN-stderr.txt b/Tests/RunCMake/CMP0152/CMP0152-WARN-stderr.txt new file mode 100644 index 0000000..8d63168 --- /dev/null +++ b/Tests/RunCMake/CMP0152/CMP0152-WARN-stderr.txt @@ -0,0 +1,27 @@ +^CMake Warning \(dev\) at CMP0152-Common\.cmake:[0-9]+ \(file\): + Policy CMP0152 is not set: file\(REAL_PATH\) resolves symlinks before + collapsing \.\./ components\. Run "cmake --help-policy CMP0152" for policy + details\. Use the cmake_policy command to set the policy and suppress this + warning\. + + From input path: + + [^ +]*/Tests/RunCMake/CMP0152/CMP0152-WARN-build/dir/bin/\.\./ + + the policy OLD behavior produces path: + + [^ +]*/Tests/RunCMake/CMP0152/CMP0152-WARN-build/dir + + but the policy NEW behavior produces path: + + [^ +]*/Tests/RunCMake/CMP0152/CMP0152-WARN-build/dir/nested + + Since the policy is not set, CMake is using the OLD behavior for + compatibility. +Call Stack \(most recent call first\): + CMP0152-WARN\.cmake:[0-9]+ \(include\) + CMakeLists.txt:[0-9]+ \(include\) +This warning is for project developers\. Use -Wno-dev to suppress it\.$ diff --git a/Tests/RunCMake/CMP0152/CMP0152-WARN.cmake b/Tests/RunCMake/CMP0152/CMP0152-WARN.cmake new file mode 100644 index 0000000..e85589e --- /dev/null +++ b/Tests/RunCMake/CMP0152/CMP0152-WARN.cmake @@ -0,0 +1,2 @@ + +include(CMP0152-Common.cmake) diff --git a/Tests/RunCMake/CMP0152/CMakeLists.txt b/Tests/RunCMake/CMP0152/CMakeLists.txt new file mode 100644 index 0000000..5ff8d3e --- /dev/null +++ b/Tests/RunCMake/CMP0152/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.23) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMP0152/RunCMakeTest.cmake b/Tests/RunCMake/CMP0152/RunCMakeTest.cmake new file mode 100644 index 0000000..7a9bab3 --- /dev/null +++ b/Tests/RunCMake/CMP0152/RunCMakeTest.cmake @@ -0,0 +1,7 @@ +include(RunCMake) + +if(NOT CMAKE_GENERATOR_NO_COMPILER_ENV) + run_cmake(CMP0152-WARN) + run_cmake(CMP0152-OLD) + run_cmake(CMP0152-NEW) +endif() diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 63b7568..608a4d9 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -165,14 +165,19 @@ if(GIT_EXECUTABLE) add_RunCMake_test(CMP0150) endif() +if(NOT WIN32 OR CYGWIN) + add_RunCMake_test(CMP0152) +endif() + # The test for Policy 65 requires the use of the # CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS variable, which both the VS and Xcode # generators ignore. The policy will have no effect on those generators. if(NOT CMAKE_GENERATOR MATCHES "Visual Studio|Xcode") add_RunCMake_test(CMP0065 -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}) endif() +add_executable(detect_jobserver detect_jobserver.c) if(CMAKE_GENERATOR MATCHES "Make") - add_RunCMake_test(Make -DMAKE_IS_GNU=${MAKE_IS_GNU}) + add_RunCMake_test(Make -DMAKE_IS_GNU=${MAKE_IS_GNU} -DDETECT_JOBSERVER=$<TARGET_FILE:detect_jobserver>) endif() unset(ninja_test_with_qt_version) unset(ninja_qt_args) @@ -363,7 +368,8 @@ if(CMake_TEST_FindOpenSSL) endif() if(CMake_TEST_UseSWIG) add_RunCMake_test(FindSWIG) - add_RunCMake_test(UseSWIG -DCMake_TEST_FindPython=${CMake_TEST_FindPython}) + add_RunCMake_test(UseSWIG -DCMake_TEST_FindPython2=${CMake_TEST_FindPython2} + -DCMake_TEST_FindPython3=${CMake_TEST_FindPython3}) endif() if(NOT CMAKE_C_COMPILER_ID MATCHES "Watcom") add_RunCMake_test(GenerateExportHeader) diff --git a/Tests/RunCMake/CXXModules/CMakeLists.txt b/Tests/RunCMake/CXXModules/CMakeLists.txt index 88eb282..640d67b 100644 --- a/Tests/RunCMake/CXXModules/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.23) project(${RunCMake_TEST} NONE) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "aa1f7df0-828a-4fcd-9afc-2dc80491aca7") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "bf70d4b0-9fb7-465c-9803-34014e70d112") include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CXXModules/examples/cxx-modules-rules.cmake b/Tests/RunCMake/CXXModules/examples/cxx-modules-rules.cmake index ff7219a..c17b5a4 100644 --- a/Tests/RunCMake/CXXModules/examples/cxx-modules-rules.cmake +++ b/Tests/RunCMake/CXXModules/examples/cxx-modules-rules.cmake @@ -1,4 +1,4 @@ -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "aa1f7df0-828a-4fcd-9afc-2dc80491aca7") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "bf70d4b0-9fb7-465c-9803-34014e70d112") if (NOT EXISTS "${CMake_TEST_MODULE_COMPILATION_RULES}") message(FATAL_ERROR diff --git a/Tests/RunCMake/CXXModules/examples/deep-chain-stderr.txt b/Tests/RunCMake/CXXModules/examples/deep-chain-stderr.txt index 78bdf2b..659414d 100644 --- a/Tests/RunCMake/CXXModules/examples/deep-chain-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/deep-chain-stderr.txt @@ -1,4 +1,4 @@ -CMake Warning \(dev\) at CMakeLists.txt:7 \(target_sources\): +CMake Warning \(dev\) at CMakeLists.txt:15 \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/deep-chain/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/deep-chain/CMakeLists.txt index 515b240..78a1d0b 100644 --- a/Tests/RunCMake/CXXModules/examples/deep-chain/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/deep-chain/CMakeLists.txt @@ -3,6 +3,14 @@ project(cxx_modules_deep_chain CXX) include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") +if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + include(CheckCompilerFlag) + check_compiler_flag(CXX "-Wread-modules-implicitly" have_implicit_module_warning) + if (have_implicit_module_warning) + add_compile_options(-Werror=read-modules-implicitly) + endif () +endif () + add_library(a STATIC) target_sources(a PUBLIC diff --git a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/test/CMakeLists.txt index d227e55..a3e55f6 100644 --- a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/test/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.24) project(cxx_modules_library NONE) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "aa1f7df0-828a-4fcd-9afc-2dc80491aca7") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "bf70d4b0-9fb7-465c-9803-34014e70d112") find_package(export_bmi_and_interfaces REQUIRED) diff --git a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/test/CMakeLists.txt index d46d28b..0144b70 100644 --- a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/test/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.24) project(cxx_modules_library NONE) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "aa1f7df0-828a-4fcd-9afc-2dc80491aca7") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "bf70d4b0-9fb7-465c-9803-34014e70d112") find_package(export_bmi_and_interfaces REQUIRED) diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-build/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-interface-build/test/CMakeLists.txt index 3cd156a..bd2f2d4 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-build/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-build/test/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.24) project(cxx_modules_library NONE) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "aa1f7df0-828a-4fcd-9afc-2dc80491aca7") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "bf70d4b0-9fb7-465c-9803-34014e70d112") find_package(export_interfaces REQUIRED) diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-install/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-interface-install/test/CMakeLists.txt index 71bf86c..87451fe 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-install/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-install/test/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.24) project(cxx_modules_library NONE) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "aa1f7df0-828a-4fcd-9afc-2dc80491aca7") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "bf70d4b0-9fb7-465c-9803-34014e70d112") find_package(export_interfaces REQUIRED) diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/test/CMakeLists.txt index 0c094ac..5b6abc6 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/test/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.24) project(cxx_modules_library NONE) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "aa1f7df0-828a-4fcd-9afc-2dc80491aca7") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "bf70d4b0-9fb7-465c-9803-34014e70d112") find_package(export_interfaces_no_properties REQUIRED) diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/test/CMakeLists.txt index 0c094ac..5b6abc6 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/test/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.24) project(cxx_modules_library NONE) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "aa1f7df0-828a-4fcd-9afc-2dc80491aca7") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "bf70d4b0-9fb7-465c-9803-34014e70d112") find_package(export_interfaces_no_properties REQUIRED) diff --git a/Tests/RunCMake/CommandLine/DeprecateVS11-WARN-ON-stderr.txt b/Tests/RunCMake/CommandLine/DeprecateVS11-WARN-ON-stderr.txt deleted file mode 100644 index 9080942..0000000 --- a/Tests/RunCMake/CommandLine/DeprecateVS11-WARN-ON-stderr.txt +++ /dev/null @@ -1,5 +0,0 @@ -^CMake Warning: - The "Visual Studio 11 2012" generator is deprecated and will be removed in - a future version of CMake. - - Add CMAKE_WARN_VS11=OFF to the cache to disable this warning.$ diff --git a/Tests/RunCMake/CommandLine/DeprecateVS12-WARN-OFF.cmake b/Tests/RunCMake/CommandLine/DeprecateVS12-WARN-OFF.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CommandLine/DeprecateVS12-WARN-OFF.cmake diff --git a/Tests/RunCMake/CommandLine/DeprecateVS12-WARN-ON-stderr.txt b/Tests/RunCMake/CommandLine/DeprecateVS12-WARN-ON-stderr.txt new file mode 100644 index 0000000..b69408e --- /dev/null +++ b/Tests/RunCMake/CommandLine/DeprecateVS12-WARN-ON-stderr.txt @@ -0,0 +1,5 @@ +^CMake Warning: + The "Visual Studio 12 2013" generator is deprecated and will be removed in + a future version of CMake. + + Add CMAKE_WARN_VS12=OFF to the cache to disable this warning.$ diff --git a/Tests/RunCMake/CommandLine/DeprecateVS12-WARN-ON.cmake b/Tests/RunCMake/CommandLine/DeprecateVS12-WARN-ON.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CommandLine/DeprecateVS12-WARN-ON.cmake diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index 45b4c0e..611dde2 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -1119,9 +1119,9 @@ if(RunCMake_GENERATOR MATCHES "^Visual Studio 9 2008") run_cmake_with_options(DeprecateVS9-WARN-OFF -DCMAKE_WARN_VS9=OFF) endif() -if(RunCMake_GENERATOR MATCHES "^Visual Studio 11 2012") - run_cmake_with_options(DeprecateVS11-WARN-ON -DCMAKE_WARN_VS11=ON) - unset(ENV{CMAKE_WARN_VS11}) - run_cmake(DeprecateVS11-WARN-ON) - run_cmake_with_options(DeprecateVS11-WARN-OFF -DCMAKE_WARN_VS11=OFF) +if(RunCMake_GENERATOR MATCHES "^Visual Studio 12 2013") + run_cmake_with_options(DeprecateVS12-WARN-ON -DCMAKE_WARN_VS12=ON) + unset(ENV{CMAKE_WARN_VS12}) + run_cmake(DeprecateVS12-WARN-ON) + run_cmake_with_options(DeprecateVS12-WARN-OFF -DCMAKE_WARN_VS12=OFF) endif() diff --git a/Tests/RunCMake/CrosscompilingEmulator/EnvCrossCompilingEmulator-stdout.txt b/Tests/RunCMake/CrosscompilingEmulator/EnvCrossCompilingEmulator-stdout.txt new file mode 100644 index 0000000..9a7d746 --- /dev/null +++ b/Tests/RunCMake/CrosscompilingEmulator/EnvCrossCompilingEmulator-stdout.txt @@ -0,0 +1,2 @@ +-- env_emulator='pseudo_emulator(\.exe)?' +-- emulator='pseudo_emulator(\.exe)?' diff --git a/Tests/RunCMake/CrosscompilingEmulator/EnvCrossCompilingEmulator.cmake b/Tests/RunCMake/CrosscompilingEmulator/EnvCrossCompilingEmulator.cmake new file mode 100644 index 0000000..55fc483 --- /dev/null +++ b/Tests/RunCMake/CrosscompilingEmulator/EnvCrossCompilingEmulator.cmake @@ -0,0 +1,6 @@ +message(STATUS "ENV{CMAKE_CROSS_COMPILING_EMULATOR}='$ENV{CMAKE_CROSSCOMPILING_EMULATOR}'") +message(STATUS "CMAKE_CROSSCOMPLING_EMULATOR='${CMAKE_CROSSCOMPILING_EMULATOR}'") +get_filename_component(env_emulator "$ENV{CMAKE_CROSSCOMPILING_EMULATOR}" NAME) +message(STATUS "env_emulator='${env_emulator}'") +get_filename_component(emulator "${CMAKE_CROSSCOMPILING_EMULATOR}" NAME) +message(STATUS "emulator='${emulator}'") diff --git a/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake b/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake index 97b7b5a..1ffd91c 100644 --- a/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake +++ b/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake @@ -26,3 +26,11 @@ set(RunCMake_TEST_OPTIONS "-DCMAKE_CROSSCOMPILING_EMULATOR=${PSEUDO_EMULATOR_CUSTOM_COMMAND_ARG}\;custom_argument") CustomCommandGenerator_run_and_build(AddCustomCommandWithArg) CustomCommandGenerator_run_and_build(AddCustomTargetWithArg) +unset(RunCMake_TEST_OPTIONS) + +function(run_EnvCrossCompilingEmulator) + set(ENV{CMAKE_CROSSCOMPILING_EMULATOR} "${PSEUDO_EMULATOR}") + run_cmake(EnvCrossCompilingEmulator) + unset(ENV{CMAKE_CROSSCOMPILING_EMULATOR}) +endfunction() +run_EnvCrossCompilingEmulator() diff --git a/Tests/RunCMake/Framework/FrameworkConsumption.cmake b/Tests/RunCMake/Framework/FrameworkConsumption.cmake index 2180cf9..f831a94 100644 --- a/Tests/RunCMake/Framework/FrameworkConsumption.cmake +++ b/Tests/RunCMake/Framework/FrameworkConsumption.cmake @@ -1,5 +1,7 @@ enable_language(C) +set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install") + # Create framework and ensure header is placed in Headers set(input_header "${CMAKE_SOURCE_DIR}/Gui.h") add_library(Gui SHARED Gui.c "${input_header}") @@ -8,6 +10,8 @@ set_target_properties(Gui PROPERTIES FRAMEWORK TRUE ) +install(TARGETS Gui DESTINATION .) + add_executable(app main.c) target_link_libraries(app PRIVATE Gui) diff --git a/Tests/RunCMake/Framework/ImportedFrameworkConsumption.cmake b/Tests/RunCMake/Framework/ImportedFrameworkConsumption.cmake new file mode 100644 index 0000000..c44a1bb --- /dev/null +++ b/Tests/RunCMake/Framework/ImportedFrameworkConsumption.cmake @@ -0,0 +1,7 @@ +enable_language(C) + +add_library(Gui IMPORTED UNKNOWN) +set_property(TARGET Gui PROPERTY IMPORTED_LOCATION "${CMAKE_BINARY_DIR}/../FrameworkConsumption-build/install/Gui.framework") + +add_executable(app main.c) +target_link_libraries(app PRIVATE Gui) diff --git a/Tests/RunCMake/Framework/RunCMakeTest.cmake b/Tests/RunCMake/Framework/RunCMakeTest.cmake index a767130..7319a59 100644 --- a/Tests/RunCMake/Framework/RunCMakeTest.cmake +++ b/Tests/RunCMake/Framework/RunCMakeTest.cmake @@ -113,7 +113,16 @@ function(framework_consumption) file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") run_cmake(FrameworkConsumption) - run_cmake_command(FrameworkConsumption-build ${CMAKE_COMMAND} --build .) + run_cmake_command(FrameworkConsumption-build ${CMAKE_COMMAND} --build . --config Release) + run_cmake_command(FrameworkConsumption-install ${CMAKE_COMMAND} --install . --config Release) + + set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/ImportedFrameworkConsumption-build") + set(RunCMake_TEST_NO_CLEAN 1) + + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + run_cmake(ImportedFrameworkConsumption) + run_cmake_command(ImportedFrameworkConsumption-build ${CMAKE_COMMAND} --build . --config Release) endfunction() framework_consumption() diff --git a/Tests/RunCMake/MSVCRuntimeTypeInfo/CMP0117-OLD-stderr.txt b/Tests/RunCMake/MSVCRuntimeTypeInfo/CMP0117-OLD-stderr.txt new file mode 100644 index 0000000..4499d97 --- /dev/null +++ b/Tests/RunCMake/MSVCRuntimeTypeInfo/CMP0117-OLD-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0117-OLD\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0117 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/Make/DetectJobServer-absent-parallel-build-stderr.txt b/Tests/RunCMake/Make/DetectJobServer-absent-parallel-build-stderr.txt new file mode 100644 index 0000000..c63bde3 --- /dev/null +++ b/Tests/RunCMake/Make/DetectJobServer-absent-parallel-build-stderr.txt @@ -0,0 +1 @@ +^(Warning: (Borland's make|NMake|Watcom's WMake) does not support parallel builds\. Ignoring parallel build command line option\.)?$ diff --git a/Tests/RunCMake/Make/DetectJobServer-absent.cmake b/Tests/RunCMake/Make/DetectJobServer-absent.cmake new file mode 100644 index 0000000..e3dddc0 --- /dev/null +++ b/Tests/RunCMake/Make/DetectJobServer-absent.cmake @@ -0,0 +1,13 @@ +# Verifies that the jobserver connection is absent +add_custom_command(OUTPUT custom_command.txt + JOB_SERVER_AWARE OFF + COMMENT "Should not detect jobserver" + COMMAND ${DETECT_JOBSERVER} --absent "custom_command.txt" +) + +# trigger the custom command to run +add_custom_target(dummy ALL + JOB_SERVER_AWARE OFF + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/custom_command.txt + COMMAND ${DETECT_JOBSERVER} --absent "custom_target.txt" +) diff --git a/Tests/RunCMake/Make/DetectJobServer-present.cmake b/Tests/RunCMake/Make/DetectJobServer-present.cmake new file mode 100644 index 0000000..a33658f --- /dev/null +++ b/Tests/RunCMake/Make/DetectJobServer-present.cmake @@ -0,0 +1,13 @@ +# Verifies that the jobserver is present +add_custom_command(OUTPUT custom_command.txt + JOB_SERVER_AWARE ON + COMMENT "Should detect jobserver support" + COMMAND ${DETECT_JOBSERVER} --present "custom_command.txt" +) + +# trigger the custom command to run +add_custom_target(dummy ALL + JOB_SERVER_AWARE ON + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/custom_command.txt + COMMAND ${DETECT_JOBSERVER} --present "custom_target.txt" +) diff --git a/Tests/RunCMake/Make/GNUMakeJobServerAware-check.cmake b/Tests/RunCMake/Make/GNUMakeJobServerAware-check.cmake new file mode 100644 index 0000000..7c5c296 --- /dev/null +++ b/Tests/RunCMake/Make/GNUMakeJobServerAware-check.cmake @@ -0,0 +1,12 @@ +# This test verifies that the commands in the generated Makefiles contain the +# `+` prefix +function(check_for_plus_prefix target) + set(file "${RunCMake_BINARY_DIR}/GNUMakeJobServerAware-build/${target}") + file(READ "${file}" build_file) + if(NOT "${build_file}" MATCHES [[\+]]) + message(FATAL_ERROR "The file ${file} does not contain the expected prefix in the custom command.") + endif() +endfunction() + +check_for_plus_prefix("CMakeFiles/dummy.dir/build.make") +check_for_plus_prefix("CMakeFiles/dummy2.dir/build.make") diff --git a/Tests/RunCMake/Make/GNUMakeJobServerAware.cmake b/Tests/RunCMake/Make/GNUMakeJobServerAware.cmake new file mode 100644 index 0000000..951c2d7 --- /dev/null +++ b/Tests/RunCMake/Make/GNUMakeJobServerAware.cmake @@ -0,0 +1,12 @@ +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/custom-command" + JOB_SERVER_AWARE ON + COMMAND $(CMAKE_COMMAND) -E touch "${CMAKE_CURRENT_BINARY_DIR}/custom-command" +) +add_custom_target(dummy ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/custom-command") + +add_custom_target( + dummy2 ALL + JOB_SERVER_AWARE ON + COMMAND ${CMAKE_COMMAND} -E true +) diff --git a/Tests/RunCMake/Make/RunCMakeTest.cmake b/Tests/RunCMake/Make/RunCMakeTest.cmake index c7717ec..12904c8 100644 --- a/Tests/RunCMake/Make/RunCMakeTest.cmake +++ b/Tests/RunCMake/Make/RunCMakeTest.cmake @@ -70,3 +70,43 @@ if(NOT RunCMake_GENERATOR STREQUAL "Watcom WMake") run_CMP0113(OLD) run_CMP0113(NEW) endif() + +function(detect_jobserver_present is_parallel) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/DetectJobServer-present-build) + set(RunCMake_TEST_NO_CLEAN 1) + set(RunCMake_TEST_OPTIONS "-DDETECT_JOBSERVER=${DETECT_JOBSERVER}") + run_cmake(DetectJobServer-present) + if (is_parallel) + run_cmake_command(DetectJobServer-present-parallel-build ${CMAKE_COMMAND} --build . -j4) + else() + run_cmake_command(DetectJobServer-present-build ${CMAKE_COMMAND} --build .) + endif() +endfunction() + +function(detect_jobserver_absent is_parallel) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/DetectJobServer-absent-build) + set(RunCMake_TEST_NO_CLEAN 1) + set(RunCMake_TEST_OPTIONS "-DDETECT_JOBSERVER=${DETECT_JOBSERVER}") + run_cmake(DetectJobServer-absent) + if (is_parallel) + run_cmake_command(DetectJobServer-absent-parallel-build ${CMAKE_COMMAND} --build . -j4) + else() + run_cmake_command(DetectJobServer-absent-build ${CMAKE_COMMAND} --build .) + endif() +endfunction() + +# Jobservers are currently only supported by GNU makes, except MSYS2 make +if(MAKE_IS_GNU AND NOT RunCMake_GENERATOR MATCHES "MSYS Makefiles") + detect_jobserver_present(ON) +else() + detect_jobserver_absent(ON) +endif() +# No matter which generator is used, the jobserver should not be present if a +# parallel build is not requested +detect_jobserver_absent(OFF) + +if(MAKE_IS_GNU) + # In GNU makes, `JOB_SERVER_AWARE` support is implemented by prefixing + # commands with the '+' operator. + run_cmake(GNUMakeJobServerAware) +endif() diff --git a/Tests/RunCMake/Ninja/QtAutoMocDeps-stderr.txt b/Tests/RunCMake/Ninja/QtAutoMocDeps-stderr.txt new file mode 100644 index 0000000..6024984 --- /dev/null +++ b/Tests/RunCMake/Ninja/QtAutoMocDeps-stderr.txt @@ -0,0 +1,8 @@ +^CMake Deprecation Warning at QtSubDir1/CMakeLists\.txt:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0116 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\.$ diff --git a/Tests/RunCMake/UseSWIG/RunCMakeTest.cmake b/Tests/RunCMake/UseSWIG/RunCMakeTest.cmake index c7a118f..537f67d 100644 --- a/Tests/RunCMake/UseSWIG/RunCMakeTest.cmake +++ b/Tests/RunCMake/UseSWIG/RunCMakeTest.cmake @@ -6,7 +6,7 @@ run_cmake(CMP0078-NEW) run_cmake(CMP0086-WARN) -if (CMake_TEST_FindPython) +if (CMake_TEST_FindPython2 OR CMake_TEST_FindPython3) macro(run_cmake_target test subtest target) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test}-build) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-OLD-Direct-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-OLD-Direct-stderr.txt new file mode 100644 index 0000000..53f603e --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-OLD-Direct-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0120-OLD-Direct\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0120 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-OLD-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-OLD-stderr.txt new file mode 100644 index 0000000..fea708f --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-OLD-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0120-OLD\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0120 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/XcodeProject-Device/DeploymentTarget.c b/Tests/RunCMake/XcodeProject-Device/DeploymentTarget.c index 5e0f40f..c00fce7 100644 --- a/Tests/RunCMake/XcodeProject-Device/DeploymentTarget.c +++ b/Tests/RunCMake/XcodeProject-Device/DeploymentTarget.c @@ -5,6 +5,10 @@ # if __MAC_OS_X_VERSION_MIN_REQUIRED != __MAC_10_11 # error macOS deployment version mismatch # endif +#elif TARGET_OS_XR +# if __XR_OS_VERSION_MIN_REQUIRED != __XROS_1_0 +# error visionOS deployment version mismatch +# endif #elif TARGET_OS_IOS # if __IPHONE_OS_VERSION_MIN_REQUIRED != __IPHONE_9_1 # error iOS deployment version mismatch diff --git a/Tests/RunCMake/XcodeProject-Device/DeploymentTarget.cmake b/Tests/RunCMake/XcodeProject-Device/DeploymentTarget.cmake index 234ceef..80e3877 100644 --- a/Tests/RunCMake/XcodeProject-Device/DeploymentTarget.cmake +++ b/Tests/RunCMake/XcodeProject-Device/DeploymentTarget.cmake @@ -7,6 +7,12 @@ if(CMAKE_SYSTEM_NAME STREQUAL "iOS") set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO") set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO") set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "NO") +elseif(CMAKE_SYSTEM_NAME STREQUAL "visionOS") + set(CMAKE_OSX_DEPLOYMENT_TARGET "1.0") + set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO") + set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO") + set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "") + set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "YES") elseif(CMAKE_SYSTEM_NAME STREQUAL "watchOS") set(CMAKE_OSX_DEPLOYMENT_TARGET "2.0") set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO") diff --git a/Tests/RunCMake/XcodeProject-Device/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject-Device/RunCMakeTest.cmake index e2ed045..b3ab624 100644 --- a/Tests/RunCMake/XcodeProject-Device/RunCMakeTest.cmake +++ b/Tests/RunCMake/XcodeProject-Device/RunCMakeTest.cmake @@ -93,6 +93,25 @@ if(NOT XCODE_VERSION VERSION_LESS 7.1) unset(RunCMake_TEST_OPTIONS) endif() +if(NOT XCODE_VERSION VERSION_LESS 15) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeBundlesVisionOS-build) + set(RunCMake_TEST_NO_CLEAN 1) + set(RunCMake_TEST_OPTIONS + "-DCMAKE_SYSTEM_NAME=visionOS" + "-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/_install") + + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + + run_cmake(XcodeBundles) + run_cmake_command(XcodeBundles-build-visionOS ${CMAKE_COMMAND} --build .) + run_cmake_command(XcodeBundles-install-visionOS ${CMAKE_COMMAND} --build . --target install) + + unset(RunCMake_TEST_BINARY_DIR) + unset(RunCMake_TEST_NO_CLEAN) + unset(RunCMake_TEST_OPTIONS) +endif() + if(NOT XCODE_VERSION VERSION_LESS 7) set(RunCMake_TEST_OPTIONS "-DCMAKE_TOOLCHAIN_FILE=${RunCMake_SOURCE_DIR}/osx.cmake") run_cmake(XcodeTbdStub) @@ -242,6 +261,10 @@ if(XCODE_VERSION VERSION_GREATER_EQUAL 8) deployment_target_test(tvOS appletvsimulator) deployment_target_test(watchOS watchos) deployment_target_test(watchOS watchsimulator) + if(XCODE_VERSION VERSION_GREATER_EQUAL 15) + deployment_target_test(visionOS xros) + deployment_target_test(visionOS xrsimulator) + endif() endif() if(XCODE_VERSION VERSION_GREATER_EQUAL 8) diff --git a/Tests/RunCMake/XcodeProject-Device/XcodeBundles.cmake b/Tests/RunCMake/XcodeProject-Device/XcodeBundles.cmake index a9fafd2..376a7fc 100644 --- a/Tests/RunCMake/XcodeProject-Device/XcodeBundles.cmake +++ b/Tests/RunCMake/XcodeProject-Device/XcodeBundles.cmake @@ -9,7 +9,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "iOS") set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "NO") endif() -if(CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "watchOS") +if(CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "visionOS" OR CMAKE_SYSTEM_NAME STREQUAL "watchOS") set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO") set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO") set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "") diff --git a/Tests/RunCMake/detect_jobserver.c b/Tests/RunCMake/detect_jobserver.c new file mode 100644 index 0000000..a6c1a7c --- /dev/null +++ b/Tests/RunCMake/detect_jobserver.c @@ -0,0 +1,204 @@ +#ifndef _CRT_SECURE_NO_WARNINGS +# define _CRT_SECURE_NO_WARNINGS +#endif + +#if defined(_MSC_VER) && _MSC_VER >= 1928 +# pragma warning(disable : 5105) /* macro expansion warning in windows.h */ +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#define MAX_MESSAGE_LENGTH 1023 +#define USAGE "Usage: %s [--present|--absent] <output_file>\n" + +// Extracts --jobserver-auth=<string> or --jobserver-fds=<string> from +// MAKEFLAGS. The returned pointer points to the start of <string> Returns NULL +// if MAKEFLAGS is not set or does not contain --jobserver-auth or +// --jobserver-fds +char* jobserver_auth(char* message) +{ + const char* jobserver_auth = "--jobserver-auth="; + const char* jobserver_fds = "--jobserver-fds="; + char* auth; + char* fds; + char* start; + char* end; + char* result; + size_t len; + + char* makeflags = getenv("MAKEFLAGS"); + if (makeflags == NULL) { + strncpy(message, "MAKEFLAGS not set", MAX_MESSAGE_LENGTH); + return NULL; + } + + // write MAKEFLAGS to stdout for debugging + fprintf(stdout, "MAKEFLAGS: %s\n", makeflags); + + auth = strstr(makeflags, jobserver_auth); + fds = strstr(makeflags, jobserver_fds); + if (auth == NULL && fds == NULL) { + strncpy(message, "No jobserver found", MAX_MESSAGE_LENGTH); + return NULL; + } else if (auth != NULL) { + start = auth + strlen(jobserver_auth); + } else { + start = fds + strlen(jobserver_fds); + } + + end = strchr(start, ' '); + if (end == NULL) { + end = start + strlen(start); + } + len = (size_t)(end - start); + result = (char*)malloc(len + 1); + strncpy(result, start, len); + result[len] = '\0'; + + return result; +} + +#if defined(_WIN32) +# include <windows.h> + +int windows_semaphore(const char* semaphore, char* message) +{ + // Open the semaphore + HANDLE hSemaphore = OpenSemaphoreA(SEMAPHORE_ALL_ACCESS, FALSE, semaphore); + + if (hSemaphore == NULL) { +# if defined(_MSC_VER) && _MSC_VER < 1900 + sprintf(message, "Error opening semaphore: %s (%ld)\n", semaphore, + GetLastError()); +# else + snprintf(message, MAX_MESSAGE_LENGTH, + "Error opening semaphore: %s (%ld)\n", semaphore, GetLastError()); +# endif + return 1; + } + + strncpy(message, "Success", MAX_MESSAGE_LENGTH); + return 0; +} +#else +# include <errno.h> +# include <fcntl.h> + +int test_fd(int read_fd, int write_fd, char* message) +{ + // Detect if the file descriptors are valid + int read_good = fcntl(read_fd, F_GETFD) != -1; + int read_error = errno; + + int write_good = fcntl(write_fd, F_GETFD) != -1; + int write_error = errno; + + if (!read_good || !write_good) { + snprintf(message, MAX_MESSAGE_LENGTH, + "Error opening file descriptors: %d (%s), %d (%s)\n", read_fd, + strerror(read_error), write_fd, strerror(write_error)); + return 1; + } + + snprintf(message, MAX_MESSAGE_LENGTH, "Success\n"); + return 0; +} + +int posix(const char* jobserver, char* message) +{ + int read_fd; + int write_fd; + const char* path; + + // First try to parse as "R,W" file descriptors + if (sscanf(jobserver, "%d,%d", &read_fd, &write_fd) == 2) { + return test_fd(read_fd, write_fd, message); + } + + // Then try to parse as "fifo:PATH" + if (strncmp(jobserver, "fifo:", 5) == 0) { + path = jobserver + 5; + read_fd = open(path, O_RDONLY); + write_fd = open(path, O_WRONLY); + return test_fd(read_fd, write_fd, message); + } + + // We don't understand the format + snprintf(message, MAX_MESSAGE_LENGTH, "Unrecognized jobserver format: %s\n", + jobserver); + return 1; +} +#endif + +// Takes 2 arguments: +// Either --present or --absent to indicate we expect the jobserver to be +// "present and valid", or "absent or invalid" +// +// if `--present` is passed, the exit code will be 0 if the jobserver is +// present, 1 if it is absent if `--absent` is passed, the exit code will be 0 +// if the jobserver is absent, 1 if it is present in either case, if there is +// some fatal error (e.g the output file cannot be opened), the exit code will +// be 2 +int main(int argc, char** argv) +{ + char message[MAX_MESSAGE_LENGTH + 1]; + char* output_file; + FILE* fp; + int expecting_present; + int expecting_absent; + char* jobserver; + int result; + + if (argc != 3) { + fprintf(stderr, USAGE, argv[0]); + return 2; + } + + expecting_present = strcmp(argv[1], "--present") == 0; + expecting_absent = strcmp(argv[1], "--absent") == 0; + if (!expecting_present && !expecting_absent) { + fprintf(stderr, USAGE, argv[0]); + return 2; + } + + output_file = argv[2]; + fp = fopen(output_file, "w"); + if (fp == NULL) { + fprintf(stderr, "Error opening output file: %s\n", output_file); + return 2; + } + + jobserver = jobserver_auth(message); + if (jobserver == NULL) { + if (expecting_absent) { + fprintf(stdout, "Success\n"); + return 0; + } + + fprintf(stderr, "%s\n", message); + return 1; + } + +#if defined(_WIN32) + result = windows_semaphore(jobserver, message); +#else + result = posix(jobserver, message); +#endif + free(jobserver); + message[MAX_MESSAGE_LENGTH] = 0; + + if (result == 0 && expecting_present) { + fprintf(stdout, "Success\n"); + return 0; + } + + if (result == 1 && expecting_absent) { + fprintf(stdout, "Success\n"); + return 0; + } + + fprintf(stderr, "%s\n", message); + return 1; +} diff --git a/Tests/RunCMake/file/REAL_PATH.cmake b/Tests/RunCMake/file/REAL_PATH.cmake index 9c5d4ea..08d400d 100644 --- a/Tests/RunCMake/file/REAL_PATH.cmake +++ b/Tests/RunCMake/file/REAL_PATH.cmake @@ -13,6 +13,43 @@ if (NOT WIN32 OR CYGWIN) if (NOT real_path STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/test.txt") message(SEND_ERROR "real path is \"${real_path}\", should be \"${CMAKE_CURRENT_BINARY_DIR}/test.txt\"") endif() + + file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/dir/") + file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/dir/nested/") + file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/dir/nested/bin/") + file(CREATE_LINK "${CMAKE_CURRENT_BINARY_DIR}/dir/nested/bin" "${CMAKE_CURRENT_BINARY_DIR}/dir/bin" SYMBOLIC) + + cmake_policy(SET CMP0152 NEW) + file(REAL_PATH "${CMAKE_CURRENT_BINARY_DIR}/dir/bin/../" real_path) + if (NOT real_path STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/dir/nested") + message(SEND_ERROR "real path is \"${real_path}\", should be \"${CMAKE_CURRENT_BINARY_DIR}/dir/nested\"") + endif() + + file(REAL_PATH "${CMAKE_CURRENT_BINARY_DIR}/dir/bin/../bin" real_path) + if (NOT real_path STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/dir/nested/bin") + message(SEND_ERROR "real path is \"${real_path}\", should be \"${CMAKE_CURRENT_BINARY_DIR}/dir/nested/bin\"") + endif() + + file(REAL_PATH "dir/bin/../bin" real_path BASE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") + if (NOT real_path STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/dir/nested/bin") + message(SEND_ERROR "real path is \"${real_path}\", should be \"${CMAKE_CURRENT_BINARY_DIR}/dir/nested/bin\"") + endif() + + file(REAL_PATH "../bin" real_path BASE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/dir/bin/" ) + if (NOT real_path STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/dir/nested/bin") + message(SEND_ERROR "real path is \"${real_path}\", should be \"${CMAKE_CURRENT_BINARY_DIR}/dir/nested/bin\"") + endif() + + cmake_policy(SET CMP0152 OLD) + file(REAL_PATH "${CMAKE_CURRENT_BINARY_DIR}/dir/bin/../" real_path) + if (NOT real_path STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/dir") + message(SEND_ERROR "real path is \"${real_path}\", should be \"${CMAKE_CURRENT_BINARY_DIR}/dir/nested\"") + endif() + file(REAL_PATH "../" real_path BASE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/dir/bin/") + if (NOT real_path STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/dir") + message(SEND_ERROR "real path is \"${real_path}\", should be \"${CMAKE_CURRENT_BINARY_DIR}/dir\"") + endif() + endif() diff --git a/Tests/RunCMake/find_library/FromScriptMode-stderr-darwin.txt b/Tests/RunCMake/find_library/FromScriptMode-stderr-darwin.txt index 185720b..b0bf460 100644 --- a/Tests/RunCMake/find_library/FromScriptMode-stderr-darwin.txt +++ b/Tests/RunCMake/find_library/FromScriptMode-stderr-darwin.txt @@ -1,4 +1,4 @@ .*find_library considered the following locations.* -.*\(lib\)library_no_exist\(\\.tbd\|\\.dylib\|\\.so\|\\.a\).* +.*liblibrary_no_exist\(\\.tbd\|\\.dylib\|\\.so\|\\.a\).* .*The item was found at.* .*lib/libcreated.a.* diff --git a/Tests/RunCMake/find_library/FromScriptMode-stderr.txt b/Tests/RunCMake/find_library/FromScriptMode-stderr.txt index 046f680..6f25184 100644 --- a/Tests/RunCMake/find_library/FromScriptMode-stderr.txt +++ b/Tests/RunCMake/find_library/FromScriptMode-stderr.txt @@ -1,4 +1,4 @@ .*find_library considered the following locations.* -.*\(lib\)library_no_exist\(\\.so\|\\.a\).* +.*liblibrary_no_exist\(\\.so\|\\.a\).* .*The item was found at.* .*lib/libcreated.a.* diff --git a/Tests/RunCMake/target_link_libraries-ALIAS/AliasTargets.cmake b/Tests/RunCMake/target_link_libraries-ALIAS/AliasTargets.cmake index 4a0f068..65c708c 100644 --- a/Tests/RunCMake/target_link_libraries-ALIAS/AliasTargets.cmake +++ b/Tests/RunCMake/target_link_libraries-ALIAS/AliasTargets.cmake @@ -14,8 +14,14 @@ set_property(TARGET import-local PROPERTY IMPORTED_LOCATION "${binary_dir}/${CMA set_property(TARGET import-local PROPERTY IMPORTED_IMPLIB "${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}func${CMAKE_IMPORT_LIBRARY_SUFFIX}") add_library(alias::local ALIAS import-local) +if(NOT DEFINED CMAKE_IMPORT_LIBRARY_SUFFIX) + add_library(import-local-stub SHARED IMPORTED) + set_property(TARGET import-local-stub PROPERTY IMPORTED_IMPLIB "${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}func${CMAKE_SHARED_LIBRARY_SUFFIX}") + add_library(alias::local-stub ALIAS import-local-stub) +endif() + add_library (lib-local SHARED lib.c) -target_link_libraries (lib-local PRIVATE alias::local) +target_link_libraries (lib-local PRIVATE alias::local $<TARGET_NAME_IF_EXISTS:alias::local-stub>) add_executable (main-local main.c) target_link_libraries (main-local PRIVATE alias::local) diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/RunCMakeTest.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/RunCMakeTest.cmake index 9b6581c..8e4745a 100644 --- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/RunCMakeTest.cmake +++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/RunCMakeTest.cmake @@ -126,7 +126,7 @@ if ((CMAKE_SYSTEM_NAME STREQUAL "Windows" AND ((DEFINED MSVC_VERSION AND MSVC_VERSION GREATER "1900") OR (CMAKE_C_COMPILER_ID MATCHES "GNU|Clang" AND NOT CMAKE_C_SIMULATE_ID STREQUAL "MSVC"))) OR (CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND (NOT CMAKE_C_COMPILER_ID STREQUAL "SunPro" OR CMAKE_C_COMPILER_VERSION GREATER "5.9")) - OR CMAKE_SYSTEM_NAME MATCHES "Darwin|iOS|tvOS|watchOS|Linux|BSD|MSYS|CYGWIN") + OR CMAKE_SYSTEM_NAME MATCHES "Darwin|iOS|tvOS|visionOS|watchOS|Linux|BSD|MSYS|CYGWIN") run_cmake(feature-WHOLE_ARCHIVE) run_cmake_target(feature-WHOLE_ARCHIVE link-exe main) endif() diff --git a/Tests/RunCMake/target_link_libraries/ImportedTargetStub.cmake b/Tests/RunCMake/target_link_libraries/ImportedTargetStub.cmake new file mode 100644 index 0000000..04f9cfb --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/ImportedTargetStub.cmake @@ -0,0 +1,2 @@ +add_library(SharedStubImportedGlobal SHARED IMPORTED GLOBAL) +set_target_properties(SharedStubImportedGlobal PROPERTIES IMPORTED_IMPLIB z) diff --git a/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake b/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake index 7c5d77d..0e3877a 100644 --- a/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake +++ b/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake @@ -23,6 +23,7 @@ run_cmake(CMP0079-link-NEW-bogus) run_cmake(CMP0108-OLD-self-link) run_cmake(CMP0108-NEW-self-link) run_cmake(ImportedTarget) +run_cmake(ImportedTargetStub) run_cmake(ImportedTargetFailure) run_cmake(MixedSignature) run_cmake(Separate-PRIVATE-LINK_PRIVATE-uses) diff --git a/Tests/RunCMake/target_link_options/LINK_OPTIONS-dollar-option-check.cmake b/Tests/RunCMake/target_link_options/LINK_OPTIONS-dollar-option-check.cmake new file mode 100644 index 0000000..0f897fe --- /dev/null +++ b/Tests/RunCMake/target_link_options/LINK_OPTIONS-dollar-option-check.cmake @@ -0,0 +1,4 @@ + +if (NOT actual_stdout MATCHES "BADFLAG_\\$dollar") + set (RunCMake_TEST_FAILED "Not found expected 'BADFLAG_$dollar'.") +endif() diff --git a/Tests/RunCMake/target_link_options/LINK_OPTIONS-dollar-option-result.txt b/Tests/RunCMake/target_link_options/LINK_OPTIONS-dollar-option-result.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/target_link_options/LINK_OPTIONS-dollar-option-result.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/target_link_options/LINK_OPTIONS.cmake b/Tests/RunCMake/target_link_options/LINK_OPTIONS.cmake index bb04841..879151b 100644 --- a/Tests/RunCMake/target_link_options/LINK_OPTIONS.cmake +++ b/Tests/RunCMake/target_link_options/LINK_OPTIONS.cmake @@ -53,3 +53,7 @@ target_link_options(LinkOptions_mod PRIVATE $<$<CONFIG:Release>:${pre}BADFLAG_RE # executable with generator expression add_executable(LinkOptions_exe LinkOptionsExe.c) target_link_options(LinkOptions_exe PRIVATE $<$<CONFIG:Release>:${pre}BADFLAG_RELEASE${obj}>) + +# executable with dollar character +add_executable(LinkOptions_dollar_exe LinkOptionsExe.c) +target_link_options(LinkOptions_dollar_exe PRIVATE "${pre}BADFLAG_$dollar${obj}") diff --git a/Tests/RunCMake/target_link_options/RunCMakeTest.cmake b/Tests/RunCMake/target_link_options/RunCMakeTest.cmake index 1a29ecf..ff0c5a8 100644 --- a/Tests/RunCMake/target_link_options/RunCMakeTest.cmake +++ b/Tests/RunCMake/target_link_options/RunCMakeTest.cmake @@ -30,7 +30,7 @@ if (NOT CMAKE_C_COMPILER_ID STREQUAL "Intel") run_cmake_target(LINK_OPTIONS shared LinkOptions_shared --config Release) run_cmake_target(LINK_OPTIONS mod LinkOptions_mod --config Release) run_cmake_target(LINK_OPTIONS exe LinkOptions_exe --config Release) - + run_cmake_target(LINK_OPTIONS dollar-option LinkOptions_dollar_exe --config Release) run_cmake(genex_LINK_LANGUAGE) diff --git a/Tests/RunCMake/target_sources/FileSetAbsoluteInstallIncludeDirExport.cmake b/Tests/RunCMake/target_sources/FileSetAbsoluteInstallIncludeDirExport.cmake new file mode 100644 index 0000000..f049d91 --- /dev/null +++ b/Tests/RunCMake/target_sources/FileSetAbsoluteInstallIncludeDirExport.cmake @@ -0,0 +1,16 @@ +enable_language(C) + +# According to https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html#module:GNUInstallDirs +# relative CMAKE_INSTALL_<dir> are encouraged, but absolute path's are also allowed. +# Construct an absolute CMAKE_INSTALL_INCLUDEDIR. +set(CMAKE_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_PREFIX}/include") + +add_library(lib1) +target_sources(lib1 + PRIVATE lib1.c + PUBLIC FILE_SET HEADERS BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} FILES h1.h) +# Expect install(TARGETS) to respect absolute CMAKE_INSTALL_INCLUDEDIR +# when installing the HEADERS. +# Must not prepend the CMAKE_INSTALL_PREFIX in the <pkg>-config.cmake. +install(TARGETS lib1 EXPORT lib1-config FILE_SET HEADERS) +install(EXPORT lib1-config NAMESPACE lib1:: DESTINATION share/lib1) diff --git a/Tests/RunCMake/target_sources/FileSetAbsoluteInstallIncludeDirImport.cmake b/Tests/RunCMake/target_sources/FileSetAbsoluteInstallIncludeDirImport.cmake new file mode 100644 index 0000000..123d6ae --- /dev/null +++ b/Tests/RunCMake/target_sources/FileSetAbsoluteInstallIncludeDirImport.cmake @@ -0,0 +1,9 @@ +enable_language(CXX) + +get_filename_component(CMAKE_PREFIX_PATH "${CMAKE_BINARY_DIR}" DIRECTORY) +string(APPEND CMAKE_PREFIX_PATH "/FileSetAbsoluteInstallIncludeDirExport-build/install") + +find_package(lib1 REQUIRED) + +add_executable(exe main.cpp) +target_link_libraries(exe PRIVATE lib1::lib1) diff --git a/Tests/RunCMake/target_sources/FileSetDefaultWrongTypeExperimental.cmake b/Tests/RunCMake/target_sources/FileSetDefaultWrongTypeExperimental.cmake index 44f1626..84e1802 100644 --- a/Tests/RunCMake/target_sources/FileSetDefaultWrongTypeExperimental.cmake +++ b/Tests/RunCMake/target_sources/FileSetDefaultWrongTypeExperimental.cmake @@ -1,6 +1,6 @@ enable_language(C) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "aa1f7df0-828a-4fcd-9afc-2dc80491aca7") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "bf70d4b0-9fb7-465c-9803-34014e70d112") add_library(lib1 STATIC empty.c) target_sources(lib1 PRIVATE FILE_SET UNKNOWN) diff --git a/Tests/RunCMake/target_sources/FileSetWrongTypeExperimental.cmake b/Tests/RunCMake/target_sources/FileSetWrongTypeExperimental.cmake index adf1185..78e782d 100644 --- a/Tests/RunCMake/target_sources/FileSetWrongTypeExperimental.cmake +++ b/Tests/RunCMake/target_sources/FileSetWrongTypeExperimental.cmake @@ -1,6 +1,6 @@ enable_language(C) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "aa1f7df0-828a-4fcd-9afc-2dc80491aca7") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "bf70d4b0-9fb7-465c-9803-34014e70d112") add_library(lib1 STATIC empty.c) target_sources(lib1 PRIVATE FILE_SET a TYPE UNKNOWN) diff --git a/Tests/RunCMake/target_sources/RunCMakeTest.cmake b/Tests/RunCMake/target_sources/RunCMakeTest.cmake index 90915cd..8505f71 100644 --- a/Tests/RunCMake/target_sources/RunCMakeTest.cmake +++ b/Tests/RunCMake/target_sources/RunCMakeTest.cmake @@ -99,3 +99,4 @@ function(run_export_import name) endfunction() run_export_import(FileSet) +run_export_import(FileSetAbsoluteInstallIncludeDir) diff --git a/Tests/SourceGroups/CMakeLists.txt b/Tests/SourceGroups/CMakeLists.txt index d726395..550fe9e 100644 --- a/Tests/SourceGroups/CMakeLists.txt +++ b/Tests/SourceGroups/CMakeLists.txt @@ -63,3 +63,5 @@ add_executable(SourceGroups main.c bar.c foo.c sub1/foo.c sub1/foobar.c baz.c ${tree_files_with_prefix} ${tree_files_without_prefix} ${tree_files_with_empty_prefix} README.txt nested.c) + +add_subdirectory(sub2) diff --git a/Tests/SourceGroups/sub2/CMakeLists.txt b/Tests/SourceGroups/sub2/CMakeLists.txt new file mode 100644 index 0000000..e457bc4 --- /dev/null +++ b/Tests/SourceGroups/sub2/CMakeLists.txt @@ -0,0 +1,4 @@ +add_executable(SourceGroups2 main.c + qux.c subsub/qax.c) + +source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" ) #PREFIX TheSubDir2 ) diff --git a/Tests/SourceGroups/sub2/main.c b/Tests/SourceGroups/sub2/main.c new file mode 100644 index 0000000..4cd8ae0 --- /dev/null +++ b/Tests/SourceGroups/sub2/main.c @@ -0,0 +1,11 @@ +#include <stdio.h> + +extern int qax(void); +extern int qux(void); + +int main() +{ + printf("qux: %d qax: %d\n", qux(), qax()); + + return 0; +} diff --git a/Tests/SourceGroups/sub2/qux.c b/Tests/SourceGroups/sub2/qux.c new file mode 100644 index 0000000..1a8b6f9 --- /dev/null +++ b/Tests/SourceGroups/sub2/qux.c @@ -0,0 +1,4 @@ +int qux(void) +{ + return 1234; +} diff --git a/Tests/SourceGroups/sub2/subsub/qax.c b/Tests/SourceGroups/sub2/subsub/qax.c new file mode 100644 index 0000000..c1b1042 --- /dev/null +++ b/Tests/SourceGroups/sub2/subsub/qax.c @@ -0,0 +1,4 @@ +int qax(void) +{ + return 123; +} diff --git a/Tests/UseSWIG/AlternateLibraryName/CMakeLists.txt b/Tests/UseSWIG/AlternateLibraryName/CMakeLists.txt index a2c239c..f20593c 100644 --- a/Tests/UseSWIG/AlternateLibraryName/CMakeLists.txt +++ b/Tests/UseSWIG/AlternateLibraryName/CMakeLists.txt @@ -7,7 +7,7 @@ include(CTest) find_package(SWIG REQUIRED) include(${SWIG_USE_FILE}) -find_package(Python2 REQUIRED COMPONENTS Interpreter Development) +find_package(Python REQUIRED COMPONENTS Interpreter Development) # Path separator if (WIN32) @@ -27,9 +27,9 @@ swig_add_library(example_python set_target_properties (example_python PROPERTIES INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/.." SWIG_USE_TARGET_INCLUDE_DIRECTORIES TRUE) -target_link_libraries(example_python PRIVATE Python2::Python) +target_link_libraries(example_python PRIVATE Python::Python) add_test (NAME AlternateLibraryName.example1 COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}${PS}$<TARGET_FILE_DIR:example_python>" - "${Python2_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/../runme.py") + "${Python_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/../runme.py") diff --git a/Tests/UseSWIG/CMakeLists.txt b/Tests/UseSWIG/CMakeLists.txt index 7c4925e..3d80270 100644 --- a/Tests/UseSWIG/CMakeLists.txt +++ b/Tests/UseSWIG/CMakeLists.txt @@ -147,16 +147,18 @@ add_test(NAME UseSWIG.MultipleModules COMMAND --build-options ${build_options} --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) -add_test(NAME UseSWIG.MultiplePython COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/UseSWIG/MultiplePython" - "${CMake_BINARY_DIR}/Tests/UseSWIG/MultiplePython" - ${build_generator_args} - --build-project TestMultiplePython - --build-options ${build_options} - --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> +if(CMake_TEST_FindPython2 AND CMake_TEST_FindPython3) + add_test(NAME UseSWIG.MultiplePython COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/UseSWIG/MultiplePython" + "${CMake_BINARY_DIR}/Tests/UseSWIG/MultiplePython" + ${build_generator_args} + --build-project TestMultiplePython + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) +endif() add_test(NAME UseSWIG.MultipleFiles COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test @@ -165,20 +167,20 @@ add_test(NAME UseSWIG.MultipleFiles COMMAND ${build_generator_args} --build-project TestMultipleFiles --build-options ${build_options} - ) - +) -add_test(NAME UseSWIG.ModuleVersion2 COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/UseSWIG/ModuleVersion2" - "${CMake_BINARY_DIR}/Tests/UseSWIG/ModuleVersion2" - ${build_generator_args} - --build-project TestModuleVersion2 - --build-options ${build_options} - --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> +if(CMake_TEST_FindPython2 OR CMake_TEST_FindPython3) + add_test(NAME UseSWIG.ModuleVersion2 COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/UseSWIG/ModuleVersion2" + "${CMake_BINARY_DIR}/Tests/UseSWIG/ModuleVersion2" + ${build_generator_args} + --build-project TestModuleVersion2 + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) - +endif() add_test(NAME UseSWIG.UseTargetINCLUDE_DIRECTORIES COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> diff --git a/Tests/UseSWIG/ModuleName/CMakeLists.txt b/Tests/UseSWIG/ModuleName/CMakeLists.txt index 435b441..c62319f 100644 --- a/Tests/UseSWIG/ModuleName/CMakeLists.txt +++ b/Tests/UseSWIG/ModuleName/CMakeLists.txt @@ -8,14 +8,7 @@ find_package(SWIG REQUIRED) cmake_policy(SET CMP0086 NEW) include(${SWIG_USE_FILE}) -find_package(Python2 REQUIRED COMPONENTS Interpreter Development) - -# Path separator -if (WIN32) - set (PS "$<SEMICOLON>") -else() - set (PS ":") -endif() +find_package(Python REQUIRED COMPONENTS Interpreter Development) unset(CMAKE_SWIG_FLAGS) @@ -34,9 +27,9 @@ set_target_properties (example1 PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/example1" ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/example1" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/example1") -target_link_libraries(example1 PRIVATE Python2::Module) +target_link_libraries(example1 PRIVATE Python::Module) add_test (NAME ModuleName.example1 - COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}/Python2${PS}$<TARGET_FILE_DIR:example1>" - "${Python2_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/runme.py") + COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:example1>" + "${Python_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/runme.py") diff --git a/Tests/UseSWIG/ModuleVersion2/CMakeLists.txt b/Tests/UseSWIG/ModuleVersion2/CMakeLists.txt index 093e858..317ed47 100644 --- a/Tests/UseSWIG/ModuleVersion2/CMakeLists.txt +++ b/Tests/UseSWIG/ModuleVersion2/CMakeLists.txt @@ -7,9 +7,6 @@ include(CTest) find_package(SWIG REQUIRED) include(${SWIG_USE_FILE}) -find_package(Python2 REQUIRED COMPONENTS Interpreter Development) -find_package(Python3 REQUIRED COMPONENTS Interpreter Development) - if (WIN32) set (PS $<SEMICOLON>) else() @@ -25,32 +22,69 @@ set_property(SOURCE "../example.i" PROPERTY COMPILE_OPTIONS -includeall) set_property(SOURCE "../example.i" PROPERTY GENERATED_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/..") -swig_add_library(example1 - LANGUAGE python - SOURCES ../example.i ../example.cxx) -set_target_properties (example1 PROPERTIES - OUTPUT_NAME example - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python2" - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python2" - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python2") -target_link_libraries(example1 PRIVATE Python2::Module) - -# re-use sample interface file for another plugin -swig_add_library(example2 - LANGUAGE python - SOURCES ../example.i ../example.cxx) -set_target_properties (example2 PROPERTIES - OUTPUT_NAME example - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python3" - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python3" - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python3") -target_link_libraries(example2 PRIVATE Python3::Module) - - -add_test (NAME ModuleVersion2.example1 - COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_PROPERTY:example1,SWIG_SUPPORT_FILES_DIRECTORY>${PS}$<TARGET_FILE_DIR:example1>" - "${Python2_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/../runme.py") - -add_test (NAME ModuleVersion2.example2 - COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_PROPERTY:example2,SWIG_SUPPORT_FILES_DIRECTORY>${PS}$<TARGET_FILE_DIR:example2>" - "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/../runme.py") +if(CMake_TEST_FindPython2) + find_package(Python2 REQUIRED COMPONENTS Interpreter Development) + + swig_add_library(example1 + LANGUAGE python + SOURCES ../example.i ../example.cxx) + set_target_properties (example1 PROPERTIES + OUTPUT_NAME example + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python2-1" + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python2-1" + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python2-1") + target_link_libraries(example1 PRIVATE Python2::Module) + + add_test (NAME ModuleVersion2.example1 + COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_PROPERTY:example1,SWIG_SUPPORT_FILES_DIRECTORY>${PS}$<TARGET_FILE_DIR:example1>" + "${Python2_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/../runme.py") + + # re-use sample interface file for another plugin + swig_add_library(example2 + LANGUAGE python + SOURCES ../example.i ../example.cxx) + set_target_properties (example2 PROPERTIES + OUTPUT_NAME example + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python2-2" + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python2-2" + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python2-2") + target_link_libraries(example2 PRIVATE Python2::Module) + + add_test (NAME ModuleVersion2.example2 + COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_PROPERTY:example2,SWIG_SUPPORT_FILES_DIRECTORY>${PS}$<TARGET_FILE_DIR:example2>" + "${Python2_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/../runme.py") +endif() + +if(CMake_TEST_FindPython3) + find_package(Python3 REQUIRED COMPONENTS Interpreter Development) + + swig_add_library(example3 + LANGUAGE python + SOURCES ../example.i ../example.cxx) + set_target_properties (example3 PROPERTIES + OUTPUT_NAME example + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python3-1" + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python3-1" + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python3-1") + target_link_libraries(example3 PRIVATE Python3::Module) + + add_test (NAME ModuleVersion2.example3 + COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_PROPERTY:example3,SWIG_SUPPORT_FILES_DIRECTORY>${PS}$<TARGET_FILE_DIR:example3>" + "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/../runme.py") + + + # re-use sample interface file for another plugin + swig_add_library(example4 + LANGUAGE python + SOURCES ../example.i ../example.cxx) + set_target_properties (example2 PROPERTIES + OUTPUT_NAME example + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python3-2" + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python3-2" + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python3-2") + target_link_libraries(example4 PRIVATE Python3::Module) + + add_test (NAME ModuleVersion2.example4 + COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_PROPERTY:example4,SWIG_SUPPORT_FILES_DIRECTORY>${PS}$<TARGET_FILE_DIR:example4>" + "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/../runme.py") +endif() diff --git a/Tests/UseSWIG/MultipleFiles/CMakeLists.txt b/Tests/UseSWIG/MultipleFiles/CMakeLists.txt index bf3d946..36734f9 100644 --- a/Tests/UseSWIG/MultipleFiles/CMakeLists.txt +++ b/Tests/UseSWIG/MultipleFiles/CMakeLists.txt @@ -11,7 +11,7 @@ unset(SWIG_LANG_DEFINITIONS) unset(SWIG_LANG_OPTIONS) unset(SWIG_LANG_LIBRARIES) -find_package(Python3 REQUIRED COMPONENTS Development) +find_package(Python REQUIRED COMPONENTS Development) set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/add.i" PROPERTY CPLUSPLUS ON) set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/sub.i" PROPERTY CPLUSPLUS ON) @@ -27,4 +27,4 @@ swig_add_library(example "${CMAKE_CURRENT_SOURCE_DIR}/add.cxx" "${CMAKE_CURRENT_SOURCE_DIR}/sub.cxx") target_include_directories(example PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") -target_link_libraries(example PRIVATE Python3::Module) +target_link_libraries(example PRIVATE Python::Module) diff --git a/Tests/UseSWIG/UseTargetINCLUDE_DIRECTORIES/CMakeLists.txt b/Tests/UseSWIG/UseTargetINCLUDE_DIRECTORIES/CMakeLists.txt index 80a2e16..6cdf987 100644 --- a/Tests/UseSWIG/UseTargetINCLUDE_DIRECTORIES/CMakeLists.txt +++ b/Tests/UseSWIG/UseTargetINCLUDE_DIRECTORIES/CMakeLists.txt @@ -7,7 +7,7 @@ include(CTest) find_package(SWIG REQUIRED) include(${SWIG_USE_FILE}) -find_package(Python3 REQUIRED COMPONENTS Interpreter Development) +find_package(Python REQUIRED COMPONENTS Interpreter Development) unset(CMAKE_SWIG_FLAGS) @@ -25,7 +25,7 @@ set_target_properties (example1 PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/example1" ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/example1" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/example1") -target_link_libraries(example1 PRIVATE Python3::Module) +target_link_libraries(example1 PRIVATE Python::Module) # Check that source property override target property @@ -42,4 +42,4 @@ set_target_properties (example2 PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/example2" ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/example2" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/example2") -target_link_libraries(example2 PRIVATE Python3::Module) +target_link_libraries(example2 PRIVATE Python::Module) diff --git a/Utilities/Doxygen/CMakeLists.txt b/Utilities/Doxygen/CMakeLists.txt index fee21b6..12b5407 100644 --- a/Utilities/Doxygen/CMakeLists.txt +++ b/Utilities/Doxygen/CMakeLists.txt @@ -3,7 +3,7 @@ if(NOT CMake_SOURCE_DIR) set(CMakeDeveloperReference_STANDALONE 1) - cmake_minimum_required(VERSION 3.13...3.25 FATAL_ERROR) + cmake_minimum_required(VERSION 3.13...3.26 FATAL_ERROR) get_filename_component(tmp "${CMAKE_CURRENT_SOURCE_DIR}" PATH) get_filename_component(CMake_SOURCE_DIR "${tmp}" PATH) include(${CMake_SOURCE_DIR}/Modules/CTestUseLaunchers.cmake) diff --git a/Utilities/Sphinx/CMakeLists.txt b/Utilities/Sphinx/CMakeLists.txt index bde6c6b..694ba3c 100644 --- a/Utilities/Sphinx/CMakeLists.txt +++ b/Utilities/Sphinx/CMakeLists.txt @@ -3,7 +3,7 @@ if(NOT CMake_SOURCE_DIR) set(CMakeHelp_STANDALONE 1) - cmake_minimum_required(VERSION 3.13...3.25 FATAL_ERROR) + cmake_minimum_required(VERSION 3.13...3.26 FATAL_ERROR) get_filename_component(tmp "${CMAKE_CURRENT_SOURCE_DIR}" PATH) get_filename_component(CMake_SOURCE_DIR "${tmp}" PATH) include(${CMake_SOURCE_DIR}/Modules/CTestUseLaunchers.cmake) diff --git a/Utilities/cmbzip2/CMakeLists.txt b/Utilities/cmbzip2/CMakeLists.txt index 1d7b265..b52358e 100644 --- a/Utilities/cmbzip2/CMakeLists.txt +++ b/Utilities/cmbzip2/CMakeLists.txt @@ -19,3 +19,7 @@ endif() add_definitions(-D_FILE_OFFSET_BITS=64) add_library(cmbzip2 blocksort.c huffman.c crctable.c randtable.c compress.c decompress.c bzlib.c) + +if(WIN32 AND CMake_BUILD_PCH) + target_precompile_headers(cmbzip2 PRIVATE "bzlib.h") +endif() diff --git a/Utilities/cmcppdap/CMakeLists.txt b/Utilities/cmcppdap/CMakeLists.txt index 39f72a2..2aca681 100644 --- a/Utilities/cmcppdap/CMakeLists.txt +++ b/Utilities/cmcppdap/CMakeLists.txt @@ -34,4 +34,8 @@ elseif(NOT APPLE) target_link_libraries(cmcppdap PRIVATE Threads::Threads) endif() +if(CMake_BUILD_PCH) + target_precompile_headers(cmcppdap PRIVATE "include/dap/protocol.h") +endif() + install(FILES NOTICE DESTINATION ${CMAKE_DOC_DIR}/cmcppdap) diff --git a/Utilities/cmcurl/lib/CMakeLists.txt b/Utilities/cmcurl/lib/CMakeLists.txt index f1d0f76..ba75420 100644 --- a/Utilities/cmcurl/lib/CMakeLists.txt +++ b/Utilities/cmcurl/lib/CMakeLists.txt @@ -110,6 +110,10 @@ set_target_properties(${LIB_NAME} PROPERTIES OUTPUT_NAME ${LIBCURL_OUTPUT_NAME} ) +if(WIN32 AND CMake_BUILD_PCH) + target_precompile_headers(${LIB_NAME} PRIVATE "curl_setup.h" "curl_sspi.h" "${CURL_SOURCE_DIR}/include/curl/curl.h") +endif() + if(0) # This code not needed for building within CMake. if(CMAKE_SYSTEM_NAME STREQUAL "AIX" OR CMAKE_SYSTEM_NAME STREQUAL "Linux" OR diff --git a/Utilities/cmlibarchive/libarchive/CMakeLists.txt b/Utilities/cmlibarchive/libarchive/CMakeLists.txt index bee69c2..e820853 100644 --- a/Utilities/cmlibarchive/libarchive/CMakeLists.txt +++ b/Utilities/cmlibarchive/libarchive/CMakeLists.txt @@ -246,6 +246,10 @@ ENDIF() ADD_LIBRARY(cmlibarchive STATIC ${libarchive_SOURCES} ${include_HEADERS}) TARGET_LINK_LIBRARIES(cmlibarchive ${ADDITIONAL_LIBS}) +if(WIN32 AND CMake_BUILD_PCH) + target_precompile_headers(cmlibarchive PRIVATE "archive_platform.h" "archive_entry.h" "<cm3p/bzlib.h>") +endif() + IF(0) # CMake does not build libarchive's full package. # Libarchive is a shared library ADD_LIBRARY(archive SHARED ${libarchive_SOURCES} ${include_HEADERS}) diff --git a/Utilities/cmliblzma/CMakeLists.txt b/Utilities/cmliblzma/CMakeLists.txt index 3121fbe..3ba3ce9 100644 --- a/Utilities/cmliblzma/CMakeLists.txt +++ b/Utilities/cmliblzma/CMakeLists.txt @@ -186,4 +186,8 @@ ELSEIF((CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "LCC" SET_PROPERTY(TARGET cmliblzma PROPERTY COMPILE_FLAGS "-O0") ENDIF() +if(WIN32 AND CMake_BUILD_PCH) + target_precompile_headers(cmliblzma PRIVATE "common/mythread.h") +endif() + INSTALL(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmliblzma) diff --git a/Utilities/cmlibuv/CMakeLists.txt b/Utilities/cmlibuv/CMakeLists.txt index ad3d433..9df0c7f 100644 --- a/Utilities/cmlibuv/CMakeLists.txt +++ b/Utilities/cmlibuv/CMakeLists.txt @@ -365,4 +365,8 @@ add_library(cmlibuv STATIC ${uv_sources}) target_link_libraries(cmlibuv ${uv_libraries}) set_property(TARGET cmlibuv PROPERTY COMPILE_DEFINITIONS ${uv_defines}) +if(WIN32 AND CMake_BUILD_PCH) + target_precompile_headers(cmlibuv PRIVATE "include/uv.h" "src/win/internal.h") +endif() + install(FILES LICENSE DESTINATION ${CMAKE_DOC_DIR}/cmlibuv) diff --git a/Utilities/std/cmext/algorithm b/Utilities/std/cmext/algorithm index 11514fc..46377f4 100644 --- a/Utilities/std/cmext/algorithm +++ b/Utilities/std/cmext/algorithm @@ -16,6 +16,7 @@ #if defined(__SUNPRO_CC) && defined(__sparc) # include <list> +# include <string> # include <vector> #endif @@ -67,11 +68,15 @@ namespace cm { APPEND_TWO(C1, C2) \ APPEND_TWO(C2, C1) -// For now, manage only support for std::vector and std::list. -// Other sequential container support can be added if needed. +// For now, manage only support for std::vector, std::list, and +// std::basic_string. Other sequential container support can be added if +// needed. APPEND(std::vector) APPEND(std::list) +APPEND(std::basic_string) APPEND_MIX(std::vector, std::list) +APPEND_MIX(std::vector, std::basic_string) +APPEND_MIX(std::list, std::basic_string) # undef APPEND # undef APPEND_MIX diff --git a/Utilities/std/cmext/iterator b/Utilities/std/cmext/iterator index eba10dd..85a28fa 100644 --- a/Utilities/std/cmext/iterator +++ b/Utilities/std/cmext/iterator @@ -24,9 +24,18 @@ using is_input_iterator = // checks if a type is a range type: std::begin() and std::end() are supported template <typename Range> -using is_range = cm::bool_constant< - cm::is_iterator<decltype(std::begin(std::declval<const Range>()))>::value && - cm::is_iterator<decltype(std::end(std::declval<const Range>()))>::value>; +using is_range = +#if defined(_MSC_VER) && _MSC_VER < 1920 + // MS C++ is not able to evaluate complex type introspection, + // so use a simplified version + cm::bool_constant<std::is_class<Range>::value || + std::is_array<Range>::value>; +#else + cm::bool_constant< + cm::is_iterator<decltype(std::begin( + std::declval<const Range>()))>::value && + cm::is_iterator<decltype(std::end(std::declval<const Range>()))>::value>; +#endif // checks if a type is an input range type: std::begin() and std::end() are // returning an input iterator diff --git a/cmake_uninstall.cmake.in b/cmake_uninstall.cmake.in index b5fc700..9e61b00 100644 --- a/cmake_uninstall.cmake.in +++ b/cmake_uninstall.cmake.in @@ -7,10 +7,10 @@ string(REPLACE "\n" ";" files "${files}") foreach(file ${files}) message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") if(EXISTS "$ENV{DESTDIR}${file}") - exec_program( - "@CMAKE_COMMAND@" ARGS "-E rm -f \"$ENV{DESTDIR}${file}\"" + execute_process( + COMMAND "@CMAKE_COMMAND@" -E rm -f "$ENV{DESTDIR}${file}" OUTPUT_VARIABLE rm_out - RETURN_VALUE rm_retval + RESULT_VARIABLE rm_retval ) if("${rm_retval}" STREQUAL 0) else() |